This is one of the most frequently asked written exam questions in SCS2108. Master the architectural comparison and dynamic method dispatch.
| Feature | Abstract Class | Interface |
|---|---|---|
| Relationship | Represents an IS-A identity (hierarchical base). | Represents a CAN-DO capability (contract). |
| Multiple Inheritance | Single inheritance only (a class can extend only 1 abstract class). | Multiple inheritance (a class can implement multiple interfaces). |
| State / Fields | Can have instance fields with state (`int balance`, `String name`). | Only `public static final` constants (no instance state). |
| Constructors | Has constructors (invoked via `super()`). | No constructors (cannot be instantiated). |
| Methods | Can have both abstract methods and concrete methods with code. | Abstract by default (Java 8+ allows `default` & `static` methods). |
Binding refers to connecting a method call to its method body.
static, final, private methods, and overloaded methods.Q: Can a Java class extend an abstract class AND implement 3 interfaces simultaneously?
public class MyClass extends MyAbstractClass implements InterfaceA, InterfaceB, InterfaceC. Java permits single class inheritance alongside multiple interface implementations.