Which keyword is used to explicitly throw an exception in Java?
finally
try
catch
throw
Which operator is used for string concatenation in Java?
/
What is the purpose of the 'this' keyword within a class?
To refer to the current object.
To access static members of the class.
To create a new instance of the class.
To call a method from the superclass.
What is the correct syntax to print 'Hello World!' to the console in Java?
System.out.println('Hello World!');
print('Hello World!');
console.log('Hello World!');
echo 'Hello World!';
What is the correct way to declare a variable in Java?
int x;
x int = 10;
int x = 10
x = 10;
Which keyword is used to define a block of code that might throw an exception?
What is the result of the expression '10 % 3' in Java?
1
3
3.33
0
Which of the following is a characteristic of unchecked exceptions in Java?
The compiler requires you to handle them explicitly.
They are not required to be declared in a method's 'throws' clause.
They are derived directly from the 'Error' class.
They typically represent recoverable situations.
What is the core principle behind Object-Oriented Programming (OOP) in Java?
Improved memory management
Code reusability
Data security
Faster execution speed
What is the primary purpose of exception handling in Java?
To completely prevent runtime errors from occurring.
To provide a mechanism for handling unexpected events during program execution.
To improve the performance of Java applications.
To enforce strict coding standards and prevent compilation errors.