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 you test a method for an exception using junit?
What do you mean by an object in java?
Describe what happens when an object is created in java ?
can we write two same methods in outer class and innerclass.
What is the format specifier?
What is meant by flickering?
Is map sorted in java?
Which package has light weight components?
Is arraylist sorted in java?
Tell me the difference between an applet and a Japplet?
java program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.
What are the various access specifiers for java classes?