Object Oriented Programming
Object Oriented Programming
Principle of Object-
Oriented Programming.
1. Learning OOP is different than learning java.
2. OOP’s concept are important.
3. Concept’s:
a. Abstraction:
b. Encapsulation:
c. Inheritance:
d. Polymorphism:
4. Abstraction:
a. Hiding internal details and showing required
features.
b. See only required things.
5. Encapsulation:
a. Binding everything inside a single container.
6. Inheritance:
a. Inheriting the properties/features from previous
things into current one
b. Same as specialization.
7. Polymorphism:
a. It is same generalization.
114. Constructor
1. Constructor: It is a method of class which is called
automatically upon creation of object.
2. Every class in java have default constructor.
3. Constructor doesn’t have any return type.
4. Usually, we make constructors public.
5. Constructors have same name as class.
6. There are two types of constructor:
a. Default constructor.
b. Parameterized constructor.
7. Constructor is used to initialize values.