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 do we make a class serialize?
What is JAVA? Why it is platform independent?
Why sleep()is in Thread and wait() in Object class? Why can't I have both in one class or vice versa?
What is t in generics in java?
Why do we need autoboxing in java?
What is unicode datatype?
What is prefix of a string?
Are nested try statements are possible?
How u dubugg ur project?
Can we declare a static variable inside a method?
Can you add null to a list java?
what is meant wrapper classes?