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.
Q 1 - What is correct syntax for main method of a java class?
Correct syntax is public static void main(String args).
The long data type is represented by 64-bit two's complement integer.
Minimum value: -263
Maximum value: 263-1
float variable has default value of 0.0f if defined as an instance/static variable.
Q 4 - Which of the following is true about String?
String object is immutable so that once it is created a String object cannot be changed. Since String is immutable it can safely be shared between many threads which are considered very important for multithreaded programming.
Q 5 - What is class variable?
Class variables are variables declared with in a class, outside any method, with the static keyword.
Yes, class with private constructor can not instantiated using new keyword.
Q 7 - Dynamic binding uses which information for binding?
Dynamic binding uses object information for binding.
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.
It is not necessary that each try block must be followed by a finally block. It should be followed by either a catch block or a finally block.
Q 10 - Which of the following is a marker interface?
serializable is a marker interface.