📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    What is the primary difference between an abstract class

    and an interface in Java (pre-Java 8)?
    A An abstract class can have concrete methods, an interface cannot. Correct Answer Incorrect Answer
    B An abstract class supports multiple inheritance, an interface does not. Correct Answer Incorrect Answer
    C An abstract class cannot have constructors, an interface can. Correct Answer Incorrect Answer
    D An abstract class can implement interfaces, an interface cannot extend classes. Correct Answer Incorrect Answer
    E An abstract class can be instantiated, an interface cannot. Correct Answer Incorrect Answer

    Solution

    Before Java 8, interfaces could only have abstract methods (and constants). Abstract classes could have both abstract and concrete (implemented) methods. This is a key distinction. (Java 8+ introduced default and static methods in interfaces, blurring this line slightly, but the core concept remains).

    Practice Next
    ask-question