Java Online Quiz


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

Q 1 - Which of the following is not a keyword in java?

A - static

B - Boolean

C - void

C - private

Answer : B


Boolean is a class and is not a keyword.

Q 2 - What is the size of long variable?

A - 8 bit

B - 16 bit

C - 32 bit

D - 64 bit

Answer : D


The long data type is represented by 64-bit two's complement integer.

Minimum value: -263

Maximum value: 263-1

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

A - 0

B - 0.0

B - null

B - undefined

Answer : A


Byte variable has default value of 0 if defined as an instance/static variable.

Answer : C


It refers to the ability to make a class abstract in OOP. It helps to reduce the complexity and also improves the maintainability of the system.

Answer : A


An applet is a Java program that runs in a Web browser.

Q 7 - Static binding uses which information for binding?

A - type.

B - object.

C - Both of the above.

D - None of the above.

Answer : A


Static binding uses type information for binding.

Answer : A


These are classes that allow primitive types to be accessed as objects. Example: Integer, Character, Double, Boolean etc.

Answer : B


Program throws "NoSuchMethodError" error at runtime.

Q 10 - Which of the following is a thread safe?

A - StringBuilder

B - StringBuffer

C - Both of the above

D - none of the above

Answer : B


StringBuffer is thread safe.


E-Books Store