Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Java Operators

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 Interfaces

Java Data Structures

Java Collections Algorithms

Advanced Java

Java Miscellaneous

Java APIs & Frameworks

Java Class References

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

Answer : A

Explaination

A class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.

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

A - 0.0

B - 0

C - null

D - not defined

Answer : B

Explaination

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

Answer : B

Explaination

An immutable object can't be changed once it is created. String objects are immutable.

Answer : C

Explaination

static block is used to initialize the static data member.It is executed before main method at the time of loading of a class.

Answer : A

Explaination

If a class has multiple functions by same name but different parameters, it is known as Method Overloading.

Answer : A

Explaination

Synchronization is the capability to control the access of multiple threads to shared resources. synchronized keyword in java provides locking which ensures mutual exclusive access of shared resource and prevent data race.

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 a marker interface?

A - serializable

B - comparable

C - cloneable

D - none of the above.

Answer : A

Explaination

serializable is a marker interface.

java_questions_answers.htm
Advertisements