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

Q 1 - What of the following is the default value of an instance variable?

A - null

B - 0

C - Depends upon the type of variable

D - Not assigned

Answer : C

Explaination

Instance variables are assigned default values based on their types. For example, int variable is assigned 0 and an object type variable is assigned null as default value.

Q 2 - What is the size of float variable?

A - 8 bit

B - 16 bit

C - 32 bit

D - 64 bit

Answer : C

Explaination

The float data type is represented by single-precision 32-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 4 - What is the default value of Boolean variable?

A - true

B - false

C - null

D - not defined

Answer : B

Explaination

boolean variable has default value of false if defined as an instance/static variable.

Answer : C

Explaination

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

Explaination

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

Answer : B

Explaination

Method Overriding is example of dynamic Binding.

Answer : A

Explaination

When a task invokes its yield() method, it returns to the ready state.

Answer : A

Explaination

The garbage collector invokes an object's finalize() method when it detects that the object has become unreachable.


java_questions_answers.htm

Advertisements
E-Books Store