21. In Java, which access modifier allows a class member to be accessed from any class, even outside the package? 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
22. What keyword is used to declare a method that is implemented in a subclass to provide a specific implementation? A. abstract B. override C. implement D. extends 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
23. In Java, what is the purpose of the final keyword when applied to a method? A. It makes the method non-final. B. It allows method overriding. C. It makes the method constant. D. It makes the method static. 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
24. Which access modifier allows a class member to be accessed from any class in the same package but not from outside? A. protected B. private C. public D. default 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
25. What keyword is used to declare a variable that can be accessed without creating an instance of the class? A. static B. final C. public D. this 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
26. Which access modifier restricts a class member's visibility to only the same class, its package, and subclasses? A. default B. private C. public D. protected 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
27. In Java, what is the purpose of the final keyword when applied to a class? A. It makes the class non-final. B. It prevents subclassing. C. It makes the class constant. D. It makes the class abstract. 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
28. Which keyword is used to declare a method that cannot be overridden in a subclass? A. final B. static C. super D. this 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
29. What is the access level of a class member declared as protected in Java? A. public B. protected C. private D. package-private 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
30. Which keyword is used to explicitly specify that a method should be overridden in a subclass? A. override B. extends C. super D. implement 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