• Post Reply Bookmark Topic Watch Topic
  • New Topic

private class/static class  RSS feed

 
Mathew Kuruvilla
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. When would we want a private class to be private?
2. Can we have mark a class to be static?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't mark a class private. Only public, abstract or final. Unless it is an inner class that is. In which case it would be to create a class which is only there for the use of the outer class in which it is defined.

Again you can't mark a class as static. That is again unless we are talking about inner classes. You do this if you want an inner class which you need to use without a reference to the outer class in which it is defined.
[ December 02, 2004: Message edited by: Paul Sturrock ]
 
Mathew Kuruvilla
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!