Java OOPS Interview Questions and Answers

    52 Votes

1. What are JAVA Byte Codes?

Java bytecode is an intermediate language which is typically compiled from Java.

2. What is JVM (Java Virtual Machine) ?

JVM stands for Java Virtual Machine which is a run time environment for the compiled java class files. JVM can execute only JAVA bytecode.

3. What is JIT (Just-in-Time) Compilation ?

There are two ways a language can be compiled
  • Compiled Language 
  • Interpreted Language

A machine understands only binary language, so finally a source code has to be compiled in binary format. In compiled way the compiler directly generate the binary file from source code.While in interpreted way it generate the class file which is then run by virtual machine.That means binary file is generated at the run time (compilation is done on need basis) this type of compilation is called JIT (Just-in-Time) compilation.

4. What is Object Oriented Programming?

  • Object-oriented programming (OOP) is a programming paradigm or a problem solving technique.
  • Object-oriented programming maps the programming model to real world concept.This is technique to think real world in terms of object. 
  • An object-oriented program may be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform.
  • In OOP, each object is capable of receiving messages, processing data, and sending messages to other objects.
5. What’s a Class?

A Class describes all the attributes of object, as well as the methods that implements the behaviour of member object. That means this is a template or blue print. In object-oriented programming , a class is a template definition of the method s and variable s in a particular kind of object . Thus, an object is a specific instance of a class; it contains real values instead of variables.
public class Person {
    String name;
    String age;
    public String getAge() {
        return age;
    public void setAge(String age) {
        this.age = age;
    public String getName() {
        return name;
    public void setName(String name) { = name;
6. What’s an Object?

Object is an instance of a class, it contains real values instead of variables.
Person employee=new Person();
7. What’s the relation between Classes and Objects?

Class is a definition, where as object is an instance of a class created.Class is a blue print while Objects are actual objects existing in the real world. Eg: Suppose person is a class- John, Sara.. are objects of class person.

8. What's singleton class ?

In object-oriented programming, a singleton class is a class that can have only one object (an instance of the class) at a time.

9. What's method In object-oriented programming ?

In object-oriented programming, a method is a programmed procedure that is defined as part of a class and included in any object of that class.

10. What are the fundamental principles of Object-oriented systems?

Abstraction, Encapsulation, Inheritance, Association, Aggregation, Polymorphism

Page 1 of 3

Popular Videos


How to improve your Interview, Salary Negotiation, Communication & Presentation Skills.

Got a tip or Question?
Let us know

Related Articles

Java Interview Questions
Top Advanced Java Interview Questions and Answers
Java Collections Interview Questions and Answers
Java Thread Interview Questions and Answers