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

Q 1 - Can we compare int variable with a boolean variable?

A - True

B - False

Answer : B

Explaination

True, Compile time error will occur if an int variable is compared with Boolean variable.

Q 2 - Can we have two public classes in one java file?

A - True

B - False

Answer : B

Explaination

No, a java file can contain only one public class.

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

A - 0.0d

B - 0.0f

C - 0

D - not defined

Answer : A

Explaination

double variable has default value of 0.0d if defined as an instance/static variable.

Answer : C

Explaination

String is a object.

Answer : C

Explaination

An interface is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface.

Answer : A

Explaination

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

Q 7 - Static binding uses which information for binding?

A - type.

B - object.

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Static binding uses type information for binding.

Answer : B

Explaination

Serialization is the process of writing the state of an object to 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