• Post Reply Bookmark Topic Watch Topic
  • New Topic

Static class??

 
Vishnu Sharma
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we make any class static?? Or only methods & variables in a class can be static??
 
Devaka Cooray
Marshal
Posts: 5216
512
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a nested class can be static
 
Vishnu Sharma
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Devaka Cooray wrote:a nested class can be static


I did not get you properly. Can you please, explain a bit more giving any small example??
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15759
74
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example:

For more information, see: The Java Tutorials - Nested Classes
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!