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 a class in java?
A class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.
True, a java file can contain one public class and many other non-public classes.
Byte variable has default value of 0 if defined as an instance/static variable.
Q 4 - Which of the following is true about super class?
All of the above are correct.
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 kind of variables a class can consist of?
A class consist of Local variable, instance variables and class variables.
Q 7 - What is function overriding?
If a subclass provides a specific implementation of a method that is already provided by its parent class, it is known as Method Overriding.
Q 8 - What are Wrapper classes?
These are classes that allow primitive types to be accessed as objects. Example: Integer, Character, Double, Boolean etc.
Q 9 - Which arithmetic operations can result in the throwing of an ArithmeticException?
Integer / and % can result in the throwing of an ArithmeticException.
Postfix operators i.e ()  . is at the highest precedence.