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

State the main difference between c++ and java?

1094


What is the integer of 16?

977


What do you mean by global variable?

954


What all methods are used to prevent thread execution ?

1035


What is the difference between a switch statement and an if statement?

1092


Is oracle java 11 free?

968


What is a generic code?

1068


Why main() method is public, static and void in java ?

1104


What is difference between equals and hashcode method?

1138


Give any two differences between C++ and java.

1150


Why main method is called first in java?

1014


What is the difference between hashset and treeset in java?

1071


What is constant in programming?

1113


How to reverse string in java?

1209


What is the difference between a factory and abstract factory pattern?

1148