- 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 : D
Explaination
The double data type is represented by double-precision 64-bit IEEE 754 floating point.
Answer : A
Explaination
int variable has default value of 0 if defined as an instance/static variable.
Q 4 - Which of the following is true about protected access modifier?
A - Variables, methods and constructors which are declared protected can be accessed by any class.
Answer : B
Explaination
Variables, methods, and constructors which are declared protected can be accessed by any class lying in the same package.
Q 5 - What is an Interface?
A - An interface is a collection of abstract methods.
B - Interface is an abstract class.
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
Holding the reference of the other class within some other class is known as composition. It represents a HAS-A relationship. For example, a Student has a Pen. Here Student class has Pen as its instance variable.
Q 7 - Static binding uses which information for binding?
Answer : A
Explaination
Static binding uses type information for binding.
Q 8 - What is Deserialization?
A - Deserialization is the process of restoring state of an object from a byte stream.
B - Serialization is the process of restoring state of an object from an object.
Answer : A
Explaination
Deserialization is the process of restoring state of an object from a byte stream.
Answer : B
Explaination
It is not necessary that each try block must be followed by a catch block. It should be followed by either a catch block or a finally block.
Q 10 - What is a marker interface?
A - marker interface is an interface with no method.
B - marker interface is an interface with single method, mark().
C - marker interface is an interface with single method, marker().
Answer : A
Explaination
Marker interface is an interface with no method.