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


    Question

    Which of the following statements about abstract methods

    in Java is true?
    A An abstract method must have a body. Correct Answer Incorrect Answer
    B An abstract method can be `static`. Correct Answer Incorrect Answer
    C An abstract method can be `final`. Correct Answer Incorrect Answer
    D An abstract method cannot be `private`. Correct Answer Incorrect Answer
    E A class containing an abstract method is not necessarily abstract. Correct Answer Incorrect Answer

    Solution

    o An abstract method is meant to be implemented (overridden) by its concrete subclasses. o A private method is not inherited by subclasses and cannot be accessed or overridden. Therefore, it makes no sense for an abstract method to be private, as it would be impossible for subclasses to provide an implementation. The compiler will produce an error if you try to declare a private abstract method.

    Practice Next
    ask-question