1. What is the default access modifier for class members in Java if no access modifier is specified? A. public B. protected C. private D. package-private Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
2. Which access modifier restricts a class member's visibility only to the same class and its subclasses? A. private B. public C. protected D. package-private Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
3. What keyword is used to declare a constant in Java, which is implicitly final and static? A. final B. const C. static D. constant Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
4. Which of the following access modifiers allows access to a class member from any class in any package? A. protected B. private C. public D. default Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
5. What is the access level of a class member with no access modifier specified in Java? A. public B. protected C. private D. package-private Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
6. In Java, which access modifier allows a method or variable to be accessed within the same package only? A. private B. public C. protected D. package-private Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
7. Which keyword is used to explicitly specify that a method cannot be overridden in a subclass? A. override B. final C. static D. super Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
8. What is the default access modifier for a class in Java if no access modifier is specified? A. private B. public C. protected D. package-private Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
9. Which access modifier allows a class member to be accessed only within its own class and package? A. public B. protected C. private D. package-private Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
10. In Java, which access modifier allows a class member to be accessed from anywhere in the code? A. public B. protected C. private D. package-private Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board