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 |
Write a program to reverse a number in java?
What is an abstract class and abstract method?
What is the difference between Trusted and Untrusted Applet ?
What is unmodifiable list in java?
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
What is difference between c++ and java ?
What is diamond operator in java?
How can the checkbox class be used to create a radio button?
How to print nodes of a Binary tree?
What is meant by attribute?
How to sort numbers in java without array?
What is a numeric digit?