why an outer class cannot be declared as private?
Answer / ravi kumar
private class PrivateClass //You cannot use private here
{
}
class TestClass //This is valid
{
}
}
This is because, in above example, if you declare PrivateClass as private then it's private to what? As Vijay said, it is of no use. So, intellisense intelligently doesn't show 'private' .
also another thing that private class can not be instantiate means u can not create object that class then what will be use of that class
| Is This Answer Correct ? | 5 Yes | 0 No |
how can we synchronize Hash map?
What variables are stored in stack?
Where local and global variables are stored?
How are destructors defined in java?
How does map works in java?
What is type inference in java8?
What is a numeric digit?
How do you achieve polymorphism in java?
Hi Friends, can you give difference between extending thread class and implementing runnable interface.
What is string pool in java?
In java, what is the difference between method overloading and method overriding?
Why do we override tostring method in java?