Win a copy of hapi.js in Action this week in the HTML, CSS and JavaScript forum!
  • 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: 5060
448
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: 15689
73
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!