Powered by Blogger.

OOPs Interview Question And Answer

Q.1- What is OOPs ?
Ans.- OOps(Object Oriented Programming System) is a Methodology to design a Program using class and Object is known as a OOps.
Q.2- What is Concepts of OOps ?
Ans.- There are following Concepts.
  1.   Object.
  2.   Class.
  3.   Inheritance.
  4.   Polymorphism.
  5.   Encapsulation.
  6.   Abstraction.

Q. 3- What is Object?
Ans.- Any Entity that has state and behavior is Called object. it can be Physical and Logical.
Q. 4- What is Class?
 Ans.- Class is Collection of object is Called Class. it is Logical Entity.
Q.5- What is Inheritance ?
Ans.- When one object Acquires all the Properties and behaviors of parent object is Called Inheritance. It provides code re-usability. it is used to achieve run-time Polymorphism.
Q.6- What is Polymorphism?
Ans.- When one Task is Performed to different way is known as a Polymorphism. in java, we  use Method Overloading and Overriding to achieve Polymorphism.
Q.7- What is Encapsulation?
Ans.-Encapsulation is the process of binding or wrapping code and data together into a single unit is Called Encapsulation. java beans is the fully of encapsulation class because all data members are private here.
Q.8- What is Abstraction?
Ans.- Abstraction is the process of Hiding internal details and showing functionality is Called Abstraction.
In java, we use abstract class and interface to achieve abstraction.
Example- Phone Call.
Q.9- Is the code compiles ? If yes then what will be the output ?


Ans.-                         Integer
                                 Object
                                  4
Q.10- Is the code compiles ? If yes then what will be the output ?
1. class is over.java

2. class is overTest.java

Ans.-       add.
Q.11- Is the code compiles ? If yes then what will be the output ?
1. class is over.java

Ans.-      I am A
              I am B
              I am c
              I am D.
Q.12- Is the code compiles ? If yes then what will be the output ?

Ans.-                     150
                             150