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...

can we declare private class in java file?

Answer Posted / manoj purohit

•Only nested classes can be private. If a top-level class
were private, nothing could access it.

So, private nested classes are just like other private
members (methods and variables)--they can only be
accessed "within the body of the top level class that
encloses the declaration of the member or constructor"

Private classes are to be used only by their declaring
class (more or less) just like other private members

Is This Answer Correct ?    117 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What methods are used in Servlet?Applet communication?

2173


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

1021


how to convert Java project into Maven ?

998


What is final modifier?

982


What are the types of sockets in java?

1049


How can you read content from file in java?

961


Can we use return in constructor?

876


Why string is a class?

890


What is the importance of main method in Java?

1015


Why are arrays useful in java?

972


What is string pool in java?

954


What is set string?

1077


What is classpath?

954


Explain the features of interfaces in java?

924


How many types of voids are there?

918