Introduction to Object-Oriented Programming
Introduction to Object-Oriented Programming
? Objects and classes ? Encapsulation and information hiding ? Mental exercises
Classification and exemplification
Aggregation and decomposition
Generalization and specialization
? Inheritance ? Polymorphism and dynamic binding ? Java an example of an object-oriented programming language
Program example
History of Java
Comparison to C/C+
OOP: Introduction
1
Objects and Classes
Mammal Two-legs Very large brains Omnivorous (plants + meat)
OOP: Introduction
Mammal Tusks
Four legs Herbivorous (plant eater)
2
The Object Concept
? An object is an encapsulation of data.
? An object has
identity (a unique reference)
social security number (cpr), employee number, passport number
state, also called characteristics (variables)
hungry, sad, drunk, running, alive
behavior (methods)
eat, drink, wave, smile, kiss
? An object is an instance of an class.
A class is often called an Abstract Data Type (ADT).
OOP: Introduction
3
The Class Concept
? A class is a collection of objects (or values) and a
corresponding set of methods.
? A class encapsulates the data representation and makes data
access possible at a higher level of abstraction.
? Example 1: A set of vehicles with operations for starting,
stopping, driving, get km/liter, etc.
? Example 2: A time interval, start time, end time, duration,
overlapping intervals, etc.
? Example 3: A string, upper case, compare, lower case, etc.
str.equals(otherStr) ? class/Java style strcmp(str, otherStr) ? C style
OOP: Introduction
4
Encapsulation and Information Hiding
? Data can be encapsulated such that it is invisible to the
"outside world".
? Data can only be accessed via methods.
Data Function Function Function
send message
Data Method Method Method
Procedural
Class
OOP: Introduction
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- object oriented programming using c
- introduction to object oriented programming
- c programming tutorial part ii object oriented
- application programming introduction and design
- object oriented programming java
- the objective c programming language
- object oriented with applications github pages
- object oriented programming
- object oriented analysis design tutorialspoint
- object oriented dbms concepts nus computing
Related searches
- object oriented programming in matlab
- matlab object oriented programming pdf
- object oriented programming tutorial pdf
- object oriented programming book pdf
- object oriented programming c pdf
- object oriented programming 2 pdf
- object oriented programming pdf download
- object oriented programming c book
- object oriented programming java examples
- object oriented programming language pdf
- object oriented programming python pdf
- c object oriented programming examples