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 a java program have 2 main methods?
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
What is hashtable and explain features of hashtable?
What is difference between equals and hashcode method?
Which of the following is not an isolation level in the JDBC
Can we clone singleton class in java?
How to find the size of an array a)array.length() b)array.length c)array.size() d)array.size
How much is a java license?
How java is similar to c?
Why packages are used?
What are non-access modifiers?
Can we define static methods inside interface?