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 a flag value?
as we know a static method could access static data and static method only. then how could main method call the object of aclass which is not static and other non static data
When would you use a static class?
What is a boolean in java?
Can we access private data outside of the class directly in java programming language? Why There is no runtime checking in java, which leads to access the private data directly outside of a class?
Why singleton is not thread safe?
What is module with example?
Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?
State the difference between strings and arrays.
What are concepts of OOPS and how are they implemented in Java?
Is null a keyword in java?
What is the purpose of the enableevents() method in java programming?