GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes can any method contain (static/non static) variables? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "can any method contain (static/non static) variables?" Watch "can any method contain (static/non static) variables?" New topic
Author

can any method contain (static/non static) variables?

sarim raza
Ranch Hand

Joined: Nov 02, 2000
Posts: 232
anyone help?
Harpal Singh
Ranch Hand

Joined: Oct 10, 2000
Posts: 229
Sarim,
Only class variables can be static or non static..other than the class....no other method let it be static method or non-static...cannot have static variables.......Methods can contain non-static variables.......because when you say something as static that means it belongs to the class as a whole not to any particular method or instance.......
Harpal
 
GeeCON Prague 2014
 
subject: can any method contain (static/non static) variables?