why an outer class cannot be declared as private?



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

Post New Answer

More Core Java Interview Questions

How do you test a method for an exception using junit?

0 Answers  


What do you mean by an object in java?

0 Answers  


Describe what happens when an object is created in java ?

0 Answers  


can we write two same methods in outer class and innerclass.

1 Answers   3i Infotech,


What is the format specifier?

0 Answers  


What is meant by flickering?

0 Answers  


Is map sorted in java?

0 Answers  


Which package has light weight components?

0 Answers  


Is arraylist sorted in java?

0 Answers  


Tell me the difference between an applet and a Japplet?

1 Answers  


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.

7 Answers   HCL, Wipro,


What are the various access specifiers for java classes?

0 Answers  


Categories