22.
In Java, can a subclass overload a method from its superclass?

23.
What is the result of the following code snippet?

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

24.
In Java, can a method be overloaded by changing only the return type?

25.
What is the purpose of method hiding in Java?

26.
In method overriding, is it mandatory for the method name in the subclass to be the same as the method name in the superclass?

27.
What happens when a subclass tries to override a static method from the superclass in Java?

28.
In method overloading, can methods have the same name and the same parameter types if their access modifiers are different?

29.
What is the purpose of method overriding in Java?

30.
In Java, can a subclass override a protected method from its superclass?