Answer Posted / manoj purohit
•Only nested classes can be private. If a top-level class
were private, nothing could access it.
So, private nested classes are just like other private
members (methods and variables)--they can only be
accessed "within the body of the top level class that
encloses the declaration of the member or constructor"
Private classes are to be used only by their declaring
class (more or less) just like other private members
| Is This Answer Correct ? | 117 Yes | 2 No |
Post New Answer View All Answers
What methods are used in Servlet?Applet communication?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?
how to convert Java project into Maven ?
What is final modifier?
What are the types of sockets in java?
How can you read content from file in java?
Can we use return in constructor?
Why string is a class?
What is the importance of main method in Java?
Why are arrays useful in java?
What is string pool in java?
What is set string?
What is classpath?
Explain the features of interfaces in java?
How many types of voids are there?