1 / 13

Object Oriented Programming with C++ syntax TA class

Object Oriented Programming with C++ syntax TA class. > February 2008, Amirkabir university, CS department. Provided by Amin Gheibi. Class.

miette
Download Presentation

Object Oriented Programming with C++ syntax TA class

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object Oriented Programming with C++ syntaxTA class > February 2008, Amirkabir university, CS department Provided by Amin Gheibi

  2. Class • A class is a software template that defines the methods and variables to be included in a particular kind of object. The methods and variables that make up the object are defined only once, in the definition of the class. The objects that belong to a class—commonly called instances of that class—contain only their own particular values for the variables.

  3. Class

  4. Class

  5. Class

  6. Implementation • It depends on programming language. Here we talk about implementation syntax in C++. • Let’s implement your design of educational system objects in C++ syntax. • Look at the board!

  7. Inheritance: IS-A relation • The mechanism whereby one class of objects can be defined as a special case of a more general class is known as inheritance. • Special cases of a class are commonly known as subclasses of that class; the more general class, in turn, is known as the superclass of its special cases. • In addition to the methods and variables they inherit, subclasses may define their own methods and variables. They can also redefine any of the inherited methods, a technique known as overriding.

  8. Inheritance

  9. Example

  10. Hierarchies of Classes • Classes can be nested to any degree, and inheritance will automatically accumulate down through all the levels. The resulting treelike structure is known as a class hierarchy.

  11. Questions ?

  12. Next discussion • Talking about objects as natural building blocks

  13. Exercise • Implement your previous model of educational system classes in C++ and instantiate some objects from them.

More Related