Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sarim raza
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone help?
 
Harpal Singh
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic