- 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 is a class in java?
B - class is a special data type.
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.
Answer : B
Explaination
No, a java file can contain only one public class.
Answer : B
Explaination
short 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 inheritance?
A - It is the process where one object acquires the properties of another.
B - inheritance is the ability of an object to take on many forms.
C - inheritance is a technique to define different methods of same type.
Answer : A
Explaination
It is the process where one object acquires the properties of another. With the use of inheritance the information is made manageable in a hierarchical order.
Q 6 - What is static block?
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.
Q 7 - Dynamic binding uses which information for binding?
Answer : B
Explaination
Dynamic binding uses object information for binding.
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 : A
Explaination
Deletion in linked list is fast because it involves only updating the next pointer in the node before the deleted node and updating the previous pointer in the node after the deleted node.
Answer : A
Explaination
Postfix operators i.e () [] . is at the highest precedence.