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 “try and catch” in java
Is singleton a bad practice?
Is string pool garbage collected?
What is the function of compareto in java?
why java uses class level type casting ?
Which is better singleton or static class?
What is method reference in java?
what is the difference b/w PUT and POST method to send data to the server
What access modifiers can be used for methods?
What is run-time class and system class? what is their purpose?
What is a control variable example?
What data type is a string?