Which of the following statements about inheritance in Java is correct?
Q.22Easy
What is the primary purpose of using the 'super' keyword in Java?
Q.23Medium
Which of the following correctly describes method overriding in Java?
Q.24Easy
In Java OOP, which principle ensures that internal details of a class are hidden from the outside world?
Q.25Medium
Which of the following statements about 'instanceof' operator is true?
Advertisement
Q.26Medium
In the context of constructors, which statement is correct?
Q.27Medium
What is the difference between 'this' and 'super' keywords in Java?
Q.28Medium
Which of the following best describes polymorphism in Java?
Q.29Medium
An abstract class in Java cannot be instantiated, but it can have concrete methods. Which statement explains why?
Q.30Medium
Which of the following correctly implements method overloading rules in Java?
Q.31Hard
In Java, if a child class constructor does not explicitly call the parent class constructor using 'super()', what happens?
Q.32Medium
Which statement about interface implementation in Java is true?
Q.33Hard
A developer needs to create a class that cannot be extended and whose instances are immutable. Which keywords should be used?
Q.34Easy
Which of the following correctly describes the relationship between a class and an interface?
Q.35Hard
When a static method is called on an instance of a class, what happens?
Q.36Hard
A company's codebase has a scenario where multiple unrelated classes need to implement a contract with specific methods. Which design choice is best?
Q.37Medium
Which statement about the 'protected' access modifier is correct?
Q.38Easy
What will be the output of the following code?
class Parent { void display() { System.out.println("Parent"); } }
class Child extends Parent { void display() { System.out.println("Child"); } }
public class Test { public static void main(String[] args) { Parent p = new Child(); p.display(); } }
Q.39Medium
Which of the following is NOT a characteristic of an interface in Java?
Q.40Easy
What is the primary purpose of the 'super' keyword in Java?