Intro To Oop
Intro To Oop
Objective:
1
STRUCTURED vs. OO PROGRAMMING
STRUCTURED PROGRAMMING:
2
Why OOP?
33
OOPs PROGRAMMING
4
OBJECT ORIENTED PROGRAMMING
Encapsulation
Abstraction
Polymorphism
Inheritance
5
Encapsulation
6
Abstraction
7
Polymorphism
8
Inheritance
9
An Inheritance Hierarchy
Superclass
Vehicle
Subclasses
10
10
Class and Object
11
Class and Object
The object is an instance of class. That has all
property of class.
The object is a clone of class and it has a
copy of all variables and methods.
public class Emp {
int x = 5;
public static void main(String[] args) {
Emp myObj = new Main();
System.out.println(myObj.x);
}
}
12
OOPs in Real World
13
Advantage of OOPs
• Importance of OOP in software development
- OOP is faster and easier to execute
-OOP provides a clear structure for the
programs
-OOP helps to keep the Java code DRY
"Don't Repeat Yourself", and makes the code
easier to maintain, modify and debug
-OOP makes it possible to create full reusable
applications with shorter development time
14
Object-Oriented Programming Languages
Pure OO Languages
Smalltalk, Eiffel, Actor, Java
Hybrid OO Languages
C++, Objective-C, Object-Pascal
15