Skip to content

Intermediate level java quiz

What is the result of the following code? String s1 = "hello"; String s2 = new String("hello"); System.out.println(s1 == s2);

Which of the following is true about method overloading in Java?

Which interface does Java's collection framework use to represent an ordered collection of elements?

What is the purpose of the `super` keyword in Java?

What will be the output of the following code? int x = 10; if (x > 5) { System.out.println("x is greater than 5"); } else { System.out.println("x is less than or equal to 5"); }

Which of the following classes is part of the Java Exception hierarchy?

What is the significance of the `final` keyword when applied to a method in Java?

What will happen if you try to access an element in a `List` using an index that is out of bounds?

Which of the following is the correct way to declare a generic class in Java?

What does the `transient` keyword do in Java?


J2J Institute private limited