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 |
What is the difference between preparedstatement and statement in java?
Explain parallel processing in java8?
what is the purpose of "virtual"?
What are Encapsulation, Polymorphism and Inheritance?
What is double in java?
What is bubble sorting in java?
Which is bigger double or float?
If there are two notepad opened and working on it . is this a process or thread? computer based Live Example to differentiate between Thread , Process , and Multi tasking ?
What are the restriction imposed on a static method or a static block of code?
What are local variables?
Why we use static and synchronized in method for single thread model example: public static synchronized add(){}
class A { class B { psvm(String args[]) { } } } if the prg saved in A.java whats the o/p?