
- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.

Q 1 - What of the following is the default value of a local variable?
Answer : D
Explaination
Local variables are not assigned any value by default.
Answer : B
Explaination
The char data type is represented by single 16-bit Unicode character.
Minimum value: '\u0000' (or 0)
Maximum value: '\uffff' (or 65,535)
Answer : A
Explaination
double variable has default value of 0.0d if defined as an instance/static variable.
Q 4 - Which of the following is true about String?
Answer : B
Explaination
String object is immutable so that once it is created a String object cannot be changed. Since String is immutable it can safely be shared between many threads which are considered very important for multithreaded programming.
Q 5 - What is an immutable object?
A - An immutable object can be changed once it is created.
B - An immutable object can't be changed once it is created.
C - An immutable object is an instance of an abstract class.
Answer : B
Explaination
An immutable object can't be changed once it is created. String objects are immutable.
Q 6 - What kind of variables a class can consist of?
A - class variables, instance variables
Answer : B
Explaination
A class consist of Local variable, instance variables and class variables.
Q 7 - What is function overloading?
A - Methods with same name but different parameters.
B - Methods with same name but different return types.
C - Methods with same name, same parameter types but different parameter names.
Answer : A
Explaination
If a class has multiple functions by same name but different parameters, it is known as Method Overloading.
Q 8 - Which is the way in which a thread can enter the waiting state?
A - Invoke its sleep() method.
B - invoke object's wait method.
Answer : D
Explaination
A thread can enter the waiting state by invoking its sleep() method, by blocking on IO, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoking its (deprecated) suspend() method.
Answer : B
Explaination
It is not necessary that each try block must be followed by a finally block. It should be followed by either a catch block or a finally block.
Answer : D
Explaination
All threads must implement the run() method.