Presentation is loading. Please wait.

Presentation is loading. Please wait.

Objects, Classes, and Methods

Similar presentations


Presentation on theme: "Objects, Classes, and Methods"— Presentation transcript:

1 Objects, Classes, and Methods
Michael M. Pickard, PhD Dept. of Computer Science Stephen F. Austin State Univ.

2 Introduction Fundamental OO Concepts in the Real World
Fundamental OOP Concepts Understanding of some OO Terms

3 Fundamental OO Concepts Related to the Real World
Class - a category of “things” of some kind For example, the “Automobile” class includes a variety of four-wheeled, mechanized vehicles. Object - one of the “things” in a given class For example, a ‘66 GTO is an object belonging to the class of Automobiles.

4 Interim Definitions: Abstract data type: a data type together with all the actions that can be performed on that data type. But what is data type?

5 Interim Definitions: Abstract data type: a data type together with all the actions that can be performed on that data type. But what is data type? One intuitive answer: The interpretation to be applied to a sequence of bits. Another: A group of data items that have the same characteristics, e.g., integers, characters, and so on.

6 Interim Definitions: Abstract data type: a data type together with all the actions that can be performed on that data type. A class can be thought of as an abstract data type that supports inheritance.

7 More Fundamental OO Concepts Related to the Real World...
A class can also be thought of as a defining a pattern for creating objects... …so that if one creates something according to the pattern, one has a new object of that class. Example: A 2013 Hyundai Accent

8 OOP Concepts - Object An instantiation of an abstract data type that supports inheritance. In other words, an object is something that is built according to the pattern defined by a class, with the additional property of inheritance.

9 Inheritance Inheritance: The ability to receive some characteristics from a “parent.”

10 OOP Concepts - Object When we create something according to the definition of a given class, we say we have created (or instantiated) a new object in that class.

11 OOP Concepts – Class (1) A class is an abstract data type that supports inheritance. A class can be thought of as a pattern for creating objects.

12 OOP Concepts - Class (2) A class defines the set of data elements (attributes) that define the objects, and the set of behaviors (methods) that manipulate the object or interact with related objects.

13 More Basic OOP Concepts. . .
In other words, a class . . . can contain data can contain operations on that data (These are called “methods” in Java.)

14 More Basic OOP Concepts. . .
Method declarations executable statements that do something hopefully!

15 Summary Fundamental OO Concepts as Related to the Real World
Basic OO Concepts


Download ppt "Objects, Classes, and Methods"

Similar presentations


Ads by Google