Mastering Java: The Ultimate Quiz for 'Thinking in Java

Question: 1 / 510

What is true about methods in a Java interface?

They can have method bodies if marked static

They are automatically public

Interface methods are automatically public, meaning they can be used and accessed by any other class. Option A is incorrect because static methods do not require an object to be called and interfaces cannot have objects. Option C is incorrect because all interface methods are abstract, meaning they do not have a method body. Option D is incorrect because all interface methods are public and therefore cannot be private.

Get further explanation with Examzify DeepDiveBeta

They must be abstract

They can be private

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy