• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

variable cannot be resolved Error

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

Trying to call array list of another class, inside main function, But getting  " cannot be resolved" Error. Any idea how to solve this ?



Rgds,
Jay
 
Greenhorn
Posts: 26
Hibernate jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use worker1.executorList
 
Sac Jadhav
Greenhorn
Posts: 26
Hibernate jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot access executorList directly
 
jaya kemmannu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Can we create object of MyRunnable in main function and then access it ?

 
Marshal
Posts: 69410
276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

jaya kemmannu wrote:. . . Trying to call array list of another class, inside main function . . .

You shouldn't want access to fields of another class. And you should't have such code in the main method. Why would you want access to such a List? When you explain what you are trying to do, you may be able to work out how to do it.
Anything created inside a method is local to that method and cannot be accessed elsewhere. Your problem is that you are not creating an object to encapsulate your application.
 
The moustache of a titan! The ad of a flea:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic