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