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
How do you declare an array in java?
What does string [] args mean?
What are constructors in java?
What are some alternatives to inheritance?
Can we override private methods?
How do you check if a number is a perfect square?
What do you understand by abstract classes?
How does enum work in java?
How many threads can java run?
What is the difference between an if statement and a switch statement?
What is object class in java?
What are the differences between this and super keyword?
How many times finalize method will be invoked? Who invokes finalize() method in java?
What does exp mean in math?
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example