Mastering Java: The Ultimate 2026 All-In-One Quiz to Excel in 'Thinking in Java

Question: 1 / 510

How do you invoke a protected method from a subclass?

Directly, if in the same package

Directly invoking a protected method from a subclass is possible if they are in the same package. If the subclass is not in the same package as the superclass, then the method cannot be directly invoked. B and C are incorrect because they do not refer to the protection level of the method or the package. D is incorrect because a protected method can be accessed from a subclass, in this case, as long as they are in the same package.

Get further explanation with Examzify DeepDiveBeta

Using super keyword

By creating an object of the superclass

It is not accessible from a subclass

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy