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


    Question

    What is the purpose of the super keyword in

    Java?
    A To refer to the current object. Correct Answer Incorrect Answer
    B To call a static method of the superclass. Correct Answer Incorrect Answer
    C To refer to the immediate parent class object. Correct Answer Incorrect Answer
    D To prevent a method from being overridden. Correct Answer Incorrect Answer
    E To declare an abstract class. Correct Answer Incorrect Answer

    Solution

    The super keyword is used to refer to the immediate parent class object. It can be used to call a superclass constructor (super(...)) or to access a superclass member (field or method) that might be hidden or overridden by the subclass (super.methodName()).

    Practice Next
    More IT Operating System Questions
    ask-question