Java Online Quiz


Advertisements


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.

Questions and Answers

Answer : A

Explaination

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.

Q 2 - What is the size of char variable?

A - 8 bit

B - 16 bit

C - 32 bit

D - 64 bit

Answer : B

Explaination

The char data type is represented by single 16-bit Unicode character.

Minimum value: '\u0000' (or 0)

Maximum value: '\uffff' (or 65,535)

Q 3 - What is the default value of float variable?

A - 0.0d

B - 0.0f

C - 0

D - not defined

Answer : B

Explaination

float variable has default value of 0.0f if defined as an instance/static variable.

Answer : C

Explaination

Instance variables are variables within a class but outside any method. These variables are instantiated when the class is loaded.

Answer : C

Explaination

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.

Answer : D

Explaination

Final classes are created so the methods implemented by that class cannot be overridden. It can't be inherited. These classes are declared final.

Answer : A

Explaination

Deserialization is the process of restoring state of an object from a byte stream.

Answer : B

Explaination

Program throws "NoSuchMethodError" error at runtime.

Answer : B

Explaination

A program is expected to recover if an exception occurs.


java_questions_answers.htm

Advertisements