nikki
Answered On : Aug 21st, 2011
I think all programs in C++ possess all features of object oriented.so we can implement a single & simpler program.
for eg:-
Code
for eg:-
class Student{
int rno;
String name,add;
public void add(int r,String n){
rno=r;
name=n;
}
public void add(String a){
add=a;
}
}
abstract class college extends Student{
int phone;
public void add(String n,String a,int rno,int p){
super();
phone=p;
}
abstract public void view(){
cout<<"name="<<name;
cout<<"address="<<address;
cout<<"phone="<<phone;
cout<<"rno="<<rno;
}
void main(){
object obj();
obj.add("ram","mig",245689,101);
obj.view();
}
}
Login to rate this answer.