Object Class & Overriding Interview Questions

    Question 1JAVA OOPS - Object Class Basics

    Which of the following is true about the Object class in Java?

    Question 2JAVA OOPS - Object Class Methods

    Which of the following methods are defined in Object class?

    Question 3JAVA OOPS - Overriding Basics

    Which statement about method overriding is true?

    Question 4JAVA OOPS - Overriding Example

    What will be printed?

    class A { void show() { System.out.println("A"); } } class B extends A { void show() { System.out.println("B"); } } public class Main { public static void main(String[] args) { A obj = new B(); obj.show(); } }

    Question 5JAVA OOPS - toString() Overriding

    What is the purpose of overriding toString() method?

    Question 6JAVA OOPS - equals() Overriding

    Which statement is correct about equals() method?

    Question 7JAVA OOPS - Final Method Overriding

    Which statement is correct?

    Question 8JAVA OOPS - Object Class hashCode()

    Which statement is true about hashCode()?

    Question 9JAVA OOPS - Object Class clone()

    Which statement is correct about clone() method?

    Question 10JAVA OOPS - Overriding Rules

    Which of the following rules is true for overriding?