Object Orinted Programing

 OOP's  Theory Based Question & Answers

1.) Object : An Object is an instance variable of class. An Object is contain an references address.

2.) Class : A class is collection of methods and objects.

3.) Encapsulation : Wrapping of the data into single unit known as encapsulation. ex. class.

4.) Inheritance : Inheritance show relationship between two classes, main purposes of inheritance is code re-usability. There are three types of inheritance, Single, Multilevel, Hierarchical.

5.)  Polymorphism : One to many form is refers to polymorphism. There are two types of polymorphism 

       (i). Method Overloading : If a class have same methods, but different parameters known as method overloading.

       (ii). Method Overloading : If a child class have same method as declared in the parent, known as the method overloading.

6.) Abstraction : Abstraction is a process of hiding implementation details and showing only essentials  information or features.

7.) Data Hiding : Data Hiding is allow to developer or programmer to protect their private data and hide                              implementation details by the help of access modifiers.

8.) Constructor : Constructor in java is used to create instance of the class. It is called at the time of instantiation. When a constructor declare , constructor name and class name must be same and constructor does not have any return type.

        There are two  of constructor : 

          (i.)  Default constructor.

         (ii.)  Parametrized constructor.

9.)  Abstract Class : A class which is declared with the abstract keyword is known as the abstract class. It can have abstract method and non abstract method. Abstract class can not be instantiated.

10.) Interface : When all methods are abstract, known as interface. Multiple inheritance in java is supported by Interface. 

 

 

Also you can download a PDF copy for this topic.

 Download Now

 

Comments

Popular posts from this blog

Mr. Myers wants to edit the marks assigned to the questions

Genral Ability