lecture-15 - C+ Inheritance and Polymorphism Part - 1...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Object Oriented Programming C++ Inheritance and Polymorphism Part - 1 R.B. Lenin Winter 2006 DA-IICT C++ Inheritance and Polymorphism Part - 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Object Oriented Programming C++ Inheritance and Polymorphism Part - 1 R.B. Lenin Winter 2006 DA-IICT Introduction • Inheritance – feature that allows one class to inherit the characteristics of another • Virtual functions – Built on foundation of inheritance – supports polymorphism
Background image of page 2
3 Object Oriented Programming C++ Inheritance and Polymorphism Part - 1 R.B. Lenin Winter 2006 DA-IICT Inheritance • A class that is inherited is called a base class. • The class that does the inheriting is called a derived class. • A derived class inherits all of the members defined by the base class and adds its own, unique elements
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Object Oriented Programming C++ Inheritance and Polymorphism Part - 1 R.B. Lenin Winter 2006 DA-IICT
Background image of page 4
5 Object Oriented Programming C++ Inheritance and Polymorphism Part - 1 R.B. Lenin Winter 2006 DA-IICT
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Object Oriented Programming C++ Inheritance and Polymorphism Part - 1 R.B. Lenin Winter 2006 DA-IICT Info for t1: Triangle is isosceles Width and height are 4 and 4 Area is 8 Info for t2: Triangle is right Width and height are 8 and 12 Area is 48
Background image of page 6
7 Object Oriented Programming C++ Inheritance and Polymorphism Part - 1 R.B. Lenin Winter 2006 DA-IICT Inheritance • Triangle Class: showStyle( ) area( ) style showDim( ) height width
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Object Oriented Programming C++ Inheritance and Polymorphism Part - 1 R.B. Lenin Winter 2006 DA-IICT Member Access and Inheritance • The general form for inheritance is class derived-class : access base-class { // body of derived class } access is optional –i f p r e s e n t
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/15/2010 for the course CSE IT325 taught by Professor Maniklaldas during the Spring '09 term at Punjab Engineering College.

Page1 / 28

lecture-15 - C+ Inheritance and Polymorphism Part - 1...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online