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 of the following is the default value of an instance variable?
Instance variables are assigned default values based on their types. For example, int variable is assigned 0 and an object type variable is assigned null as default value.
The char data type is represented by single 16-bit Unicode character.
Minimum value: '\u0000' (or 0)
Maximum value: '\uffff' (or 65,535)
float variable has default value of 0.0f if defined as an instance/static variable.
Q 4 - Which of the following is true about public access modifier?
Public access modifier is used to make variables, methods and constructors accessible to any class.
Q 5 - What is instance variable?
Instance variables are variables within a class but outside any method. These variables are instantiated when the class is loaded.
Q 6 - What is an applet?
An applet is a Java program that runs in a Web browser.
Q 7 - What is function overloading?
If a class has multiple functions by same name but different parameters, it is known as Method Overloading.
Q 8 - What is Serialization?
Serialization is the process of writing the state of an object to a byte stream.
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.
All threads must implement the run() method.