This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can any method contain (static/non static) variables?