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 double variable?

A - 8 bit

B - 16 bit

C - 32 bit

D - 64 bit

Answer : D

Explaination

The double data type is represented by double-precision 64-bit IEEE 754 floating point.

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

A - '\u0000'

B - 0

C - null

D - not defined

Answer : A

Explaination

char variable has default value of '\u0000' if defined as an instance/static variable.

Q 5 - Inheritance represents

A - HAS-A relationship.

B - IS-A relationship.

Answer : B

Explaination

Inheritance represets IS-A relationship providing code reusablity . Consider the following statement: Circle is a Shape. Here Shape is super class and Circle is a child class extends the super class Shape.

Answer : C

Explaination

Set is a collection of element which cannot contain duplicate elements. The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are prohibited.

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.

Q 9 - Can try statements be nested?

A - True.

B - False.

Answer : A

Explaination

Yes, try statements be nested.

Q 10 - Which of the following is Faster, StringBuilder or StringBuffer?

A - StringBuilder

B - StringBuffer

C - Both of the above.

D - none of the above.

Answer : A

Explaination

StringBuilder is faster than StringBuffer.

java_questions_answers.htm
Advertisements