Java Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Core Java. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
![Questions and Answers](../images/questions_and_answers.png)
Answer : B
Explaination
Boolean is a class and is not a keyword.
Answer : B
Explaination
No, a java file can contain only one public class.
Answer : B
Explaination
float variable has default value of 0.0f if defined as an instance/static variable.
Q 4 - Which of the following is false about String?
B - String can be created using new operator.
Answer : C
Explaination
String is a object.
Answer : B
Explaination
Inheritance represets IS-A relationship providing code reusablity . Consider the following statement: Circle is a Shape. Here Shape is super class and Circle is a child class extends the super class Shape.
Q 6 - What is JRE?
A - JRE is a java based GUI application.
B - JRE is an application development framework.
C - JRE is an implementation of the Java Virtual Machine which executes Java programs.
Answer : C
Explaination
Java Runtime Environment is an implementation of the Java Virtual Machine which executes Java programs. It provides the minimum requirements for executing a Java application.
Q 7 - When static binding occurs?
A - Static binding occurs during Compile time.
B - Static binding occurs during load time.
Answer : A
Explaination
Static binding occurs during Compile time.
Q 8 - Which is the way in which a thread can enter the waiting state?
A - Invoke its sleep() method.
B - invoke object's wait method.
Answer : D
Explaination
A thread can enter the waiting state by invoking its sleep() method, by blocking on IO, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoking its (deprecated) suspend() method.
Answer : A
Explaination
Yes, try statements be nested.
Q 10 - This is the parent of Error and Exception classes.
Answer : A
Explaination
Throwable is the parent of both Error and Exception class.