H includeconioh class test private int x public int

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: rivate: int x; Public: int y; Protected: int z; }; Class test1: public test{ Public: int a; a=y; }; Main(){ Test t1; t1.y; t1. z; t1. //error //error } Example2 on Inheritance Example2 class X { public: void message(){ Cout<<“Welcome to Inheritance”; } }; class Y: public X { }; Void main() { X x; Y y; x.message(); y.message(); //for verification, call Y } Example3 on Inheritance Example3 //inheritance program... #include<iostream.h> #include<conio.h> class point { int x,y; pub...
View Full Document

This document was uploaded on 03/16/2014.

Ask a homework question - tutors are online