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

A - 0

B - 0.0

C - 0L

D - not defined

Answer : C

Explaination

long variable has default value of 0L 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

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

Q 6 - Can be constructor be made final?

A - True.

B - False.

Answer : B

Explaination

No, this is not possible.

Answer : A

Explaination

Method Overloading is example of static binding.

Answer : A

Explaination

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

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