Which of these is a valid way to call a method named 'calculateArea' in Java?
calculateArea()
calculateArea;
Area.calculate()
call calculateArea()
Which method is used to remove an element at a specific index from an ArrayList?
remove()
delete()
discard()
extract()
What is the purpose of the 'switch' statement in Java?
To declare a variable
To define a method
To check a condition and execute different code blocks based on the result
To execute a block of code repeatedly
What is the default value of an element in an array of type double?
double
0.0
null
undefined
0
What is the parent class of all exception classes in Java?
Error
RuntimeException
Exception
Throwable
What is the result of the expression '10 % 3' in Java?
3.33
1
3
Which of the following is NOT a primitive data type in Java?
boolean
String
int
Which of the following describes method overloading in Java?
Changing the behavior of an existing method
Returning different data types from the same method
Defining multiple methods with the same name and different parameters
Calling a method from within itself
Which component of the Java Development Kit (JDK) is responsible for converting Java source code (.java files) into bytecode (.class files)?
Integrated Development Environment (IDE)
Java Virtual Machine (JVM)
Java Runtime Environment (JRE)
Java Compiler (javac)
What is essential to prevent infinite recursion in a Java method?
A loop within the recursive method
A conditional statement that terminates the recursion
A return statement in all code paths
Using a different method name for each recursive call