Question 1 of 25
Hints left: 3
Q1
What is the primary purpose of the `finally` block in a Java exception handling structure?
Q2
What is the output of the following code snippet in Java? `System.out.println("Java".substring(0, 2));`
Q3
What is the purpose of the `String.format()` method in Java?
Q4
What is the purpose of the `@SuppressWarnings` annotation in Java?
Q5
In Java, what does the `System.exit(0);` statement do?
Q6
Which Java operator is used for short-circuit logical OR?
Q7
In Java, what is the purpose of the `NullPointerException`?
Q8
Which Java operator is used to perform a logical NOT operation?
Q9
In Java, what is the role of the `System.arraycopy` method?
Q10
Which Java keyword is used to explicitly specify that a variable cannot be changed after it is assigned a value?
Q11
What is the result of the following code in Java? `System.out.println(10 > 5 ? "true" : "false");`
Q12
Which Java operator is used to perform bitwise AND between two integers?
Q13
What is the result of the following code in Java? `System.out.println(5 / 0);`
Q14
In Java, which data type is used to represent true or false values?
Q15
What does the `finally` block in a Java `try-catch-finally` construct do?
Q16
What does the `break` statement do when used in a `switch` statement in Java?
Q17
Which Java keyword is used to create a new instance of a class?
Q18
Which Java keyword is used to define a constant interface?
Q19
Which Java keyword is used to declare a class method that can be called without creating an instance of the class?
Q20
In Java, which collection is typically implemented as a dynamic array that can grow or shrink in size?
Q21
In Java, which collection class does not allow duplicate elements and is typically implemented as a binary tree?
Q22
Which Java exception is thrown when an array index is out of bounds?
Q23
What is the purpose of the `try-with-resources` statement in Java?
Q24
In Java, which data type represents a sequence of characters and is enclosed in double quotes?
Q25
What is the purpose of the `@Override` annotation in Java?