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 |
Can inner class be public in java?
What is the difference between stringbuffer and stringbuilder class?
What is the difference between actual and formal parameters?
Can a class be subclass of itself?
What is hashing in java?
What is the use of flag?
How do I find and replace in word?
What is the difference between class forname and new?
What is the java reflection api? Why it’s so important to have?
What is the difference between an argument and a parameter?
Can you have an inner class inside a method and what variables can you access?
What is the applet security manager, and what does it provide?