#include<iostream.h>
#include<conio.h>
class Add
{
Private:
ont a;
Public:
int b;
void display( )
{
a=8;
b=9;
cout<<"\n a="<<a; //can be access
cout<"\ b ="<<b; // can be access
}
};
main( )
{
clrscr()
Add a1;
a1.display( );
// cout<<"\n private value of class ="<<a1.a;
// can't be Access
cout <<"\n public value of class="<<a1.b;
getch();
}
No comments:
Post a Comment