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 / ranganathkini

A class can be marked by the "private" access specifier only
if its a nested member of another class.

Top level classes cannot be marked as "private". Hence you
can have private classes in a java file but they must be
nested inside another class.

Is This Answer Correct ?    208 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we convert stringbuilder to string in java?

980


What is treemap in java?

940


What happens when I use / and % with a negative numerator?

1039


What is the java reflection api? Why it’s so important to have?

977


What are serialization and deserialization?

1253


Explain the difference between comparator and comparable in java?

941


Does java linked list allow duplicates?

969


What is an i/o filter?

1797


What class allows you to read objects directly from a stream in java programming?

1066


What are the advantages of java over C++?

1195


what is abstract class in Java?

1112


What are parameters in a method?

1096


Can we use both this () and super () in a constructor?

1000


Can we create an object of private class?

964


Which is easier netbeans or eclipse?

1058