• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the Purpose of Having a Nested Java Class That is Private Static  RSS feed

 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand "private" and "static".

What is the purpose of having a "private static" nested Java class? I have never run into a situation of using it. Please help me in understaning it. Thank you.
 
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For Utility/Encapsulation purposes. For example the public class may have a private member variable which requires an awful lot of static initialisation that the developer feels belongs 'in a different class', I could see mathematics utilities for example using this technique (but it would be pretty rare).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!