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

How do you declare an array in java?

1002


What does string [] args mean?

969


What are constructors in java?

1041


What are some alternatives to inheritance?

1058


Can we override private methods?

988


How do you check if a number is a perfect square?

950


What do you understand by abstract classes?

1028


How does enum work in java?

974


How many threads can java run?

1069


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

1113


What is object class in java?

887


What are the differences between this and super keyword?

912


How many times finalize method will be invoked? Who invokes finalize() method in java?

979


What does exp mean in math?

948


Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example

2555