Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Class Contents  RSS feed

 
Ramesh Pappala
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to my knowledge a class can contain
1.Member variables
2.Member functions
3.Static blocks
4.Non-Static blocks
5.Constructors
6.Inner Classes

Is there are any things which a class can contain other than the above specified things.
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to my knowledge a class can contain
1.Member variables
2.Member functions
3.Static blocks
4.Non-Static blocks
5.Constructors
6.Inner Classes

Is there are any things which a class can contain other than the above specified things.
Yes; class (static) members (variables and methods) and nested classes (superset of inner classes), nested interfaces, etc. off the top of my head.

For the complete list, check the JLS: http://java.sun.com/docs/books/jls/third_edition/html/classes.html
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!