Access Modifiers in Java – Objective

This “Core Java Practice Test on Access Modifiers in Java” providing set of objective type questions on java Access Modifiers to test your theoretical skills and technical skills.


1. Can we access private members from another class with in the package?

 
 
 
 

2. Can we import package level class from another package?

 
 
 
 

3. Can we access protected members of class from another package?

 
 
 
 
 

4. Can we define class as protected ?

 
 
 
 

5. Can we apply access modifiers to local variables?

 
 
 
 

6. What is the default access modifier in java?

 
 
 
 

7. How many access modifiers does java supports?

 
 
 
 

8. Can we define class as private?

 
 
 
 

9. Why can’t we apply access modifiers to blocks?

 
 
 
 

10. Can we define constructor as private?

 
 
 
 

Question 1 of 10

Share this