This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Don't get me started about those stupid light bulbs.
 
subject: can any method contain (static/non static) variables?
 
Similar Threads
static and non static methods
property file dynamic vs static
Single tone Vs Static
WA #1.....word association
static and non static methods