Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What is a flag value?

0 Answers  


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

1 Answers  


When would you use a static class?

0 Answers  


What is a boolean in java?

0 Answers  


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?

5 Answers   Google,


Why singleton is not thread safe?

0 Answers  


What is module with example?

0 Answers  


Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?

0 Answers  


State the difference between strings and arrays.

0 Answers   Syntel, Visa,


What are concepts of OOPS and how are they implemented in Java?

2 Answers   KPIT,


Is null a keyword in java?

0 Answers  


What is the purpose of the enableevents() method in java programming?

0 Answers  


Categories