Java Tutorial

Java Control Statements

Object Oriented Programming

Java Built-in Classes

Java File Handling

Java Error & Exceptions

Java Multithreading

Java Synchronization

Java Networking

Java Collections

Java List Interface

Java Queue Interface

Java Map Interface

Java Set Interface

Java Data Structures

Java Collections Algorithms

Advanced Java

Java Miscellaneous

Java APIs & Frameworks

Java Useful Resources

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 - Static functions can be accessed using null reference.

A - True

B - False

Answer : A

Explaination

True, Static functions can be accessed via class name or via null reference.

Q 2 - What is the size of boolean variable?

A - 8 bit

B - 16 bit

C - 32 bit

D - not precisely defined

Answer : B

Explaination

The boolean data type can take either true or false, but its "size" isn't precisely defined.

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

A - 0

B - 0.0

C - null

D - not defined

Answer : A

Explaination

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

Q 4 - What is the default value of Object variable?

A - undefined

B - 0

C - null

D - not defined

Answer : C

Explaination

Object variable has default value of null if defined as an instance/static variable.

Q 5 - A class always has a default constructor.

A - True

B - False

Answer : B

Explaination

It is not mandatory to have a default constructor in a class.

Q 6 - Can be constructor be made private?

A - True.

B - False.

Answer : A

Explaination

Yes, class with private constructor can not instantiated using new keyword.

Answer : A

Explaination

Method Overloading is example of static binding.

Answer : A

Explaination

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

Q 9 - Is it necessary that each try block must be followed by a catch block?

A - True.

B - False.

Answer : B

Explaination

It is not necessary that each try block must be followed by a catch block. It should be followed by either a catch block or a finally block.

java_questions_answers.htm
Advertisements