Vidyalelo
Java Programming · Q8

Interfaces and Abstract Classes

Programming · Java Programming · question 8

Q8

In Java, can an interface have fields (member variables)?

A.
Only if they are marked as "static"
B.
Only if they are marked as "private"
C.
No, interfaces cannot have fields
D.
Yes, an interface can have constant (final) fields
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board