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.
Objects are allocated memory in heap memory space.
The double data type is represented by double-precision 64-bit IEEE 754 floating point.
int variable has default value of 0 if defined as an instance/static variable.
Q 4 - Which of the following is true about protected access modifier?
Variables, methods, and constructors which are declared protected can be accessed by any class lying in the same package.
It is not mandatory to have a default constructor in a class.
Q 6 - What is JRE?
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 - What is NullPointerException?
A NullPointerException is thrown when calling the instance method of a null object or modifying/accessing field of a null object.
Q 8 - What invokes a thread's run() method?
After a thread is started, via its start() method of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.
Q 9 - What is runtime polymorphism?
Runtime polymorphism or dynamic method dispatch is a process in which a call to an overridden method is resolved at runtime rather than at compile-time. In this process, an overridden method is called through the reference variable of a superclass.
Q 10 - In which case, a program is expected to recover?
A program is expected to recover if an exception occurs.