What is the primary advantage of using interfaces over abstract classes in Java?
Tripura Public Service Commission - 2026,
Answer: B
The main advantage is that a class can implement multiple interfaces.
Java allows a class to extend only one class, abstract or not, but to implement any number of interfaces. Interfaces are therefore Java's way of giving a class several types, a form of multiple inheritance of type.
The other options are false. Interfaces cannot have constructors, and they cannot have instance variables, since all their fields are implicitly public, static and final. They give no speed advantage. Abstract classes are the ones that can have constructors and instance state.
Please log in or register to report this question.