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).
No, a java file can contain only one public class.
double variable has default value of 0.0d if defined as an instance/static variable.
Q 4 - What is polymorphism?
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.
Q 5 - What is local variable?
Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and it will be destroyed when the method has completed.
Q 6 - What is TreeSet Interface?
TreeSet is a Set implemented when we want elements in a sorted order.
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.
Q 9 - Which arithmetic operations can result in the throwing of an ArithmeticException?
Integer / and % can result in the throwing of an ArithmeticException.
Q 10 - Which of the following is Faster, StringBuilder or StringBuffer?
StringBuilder is faster than StringBuffer.