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

What is constructor and virtual function? Can we call a virtual function in a constructor?

1082


When do we need to use internal iteration? When do we need to use external iteration?

1061


How to change value in arraylist java?

1096


Is space a char?

880


Differences between C and Java?

1116


What is struts in java?

987


What do you mean by singleton class in java?

855


What is proper subset?

917


Why pointers are not used in java?

1047


What is r in java?

997


How do you create a method in java?

941


What is mutable object and immutable object?

1080


Is passing by reference faster?

941


why an outer class cannot be declared as private?

4223


Why javac is not recognized?

893