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


    Question

    In Java, a class can inherit from how many other classes

    directly?
    A Zero Correct Answer Incorrect Answer
    B One Correct Answer Incorrect Answer
    C Two Correct Answer Incorrect Answer
    D Three Correct Answer Incorrect Answer
    E Unlimited Correct Answer Incorrect Answer

    Solution

    Java supports single inheritance for classes, meaning a class can directly extend only one other class. This prevents the "diamond problem" of multiple inheritance. However, a class can implement multiple interfaces.

    Practice Next
    ask-question