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


How does access modifiers work?



How does access modifiers work?..

Answer / javamasque

Public: It is the highest visibility access modifier. It makes visible the class members (variables/methods) to any classes (child/non-child) present within same or any package.
Protected: It has lesser visibility than public access modifier. It makes visible the class members (variables/methods) to sub-classes within same or different package and it also make visible in any class of same package.
Default: It has lesser visibility than protected access modifier. It makes visible the class members (variables/methods) to any classes within same package only.
Private: It has least visibility than all access modifiers. It makes visible the class members (variables/methods) within same class only.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More Core Java Interview Questions

How do you start a thread?

0 Answers  


Can we override the main method?

4 Answers  


What is static method with example?

0 Answers  


What is vector?

0 Answers  


What Method and class used for Connection pooling ?

5 Answers   TCS, Wipro,


Is delete, next, main, exit or null keyword in java?

1 Answers  


Why stringbuilder is not thread safe in java?

0 Answers  


how many ways we can serialize the java object?

2 Answers   Satyam,


whst is encapsulation?when u encpsulate actually while devoloping code?

7 Answers   Amdocs, MGL,


How are destructors defined in java?

0 Answers  


What is a top level class in java?

0 Answers  


what is the difference between process and thread? : Java thread

0 Answers  


Categories