Answer Posted / shafi . shaik
//The Concepts of interface classes in Java (Function
Overriding
#include<iostream.h>
#include<conio.h>
class A
{
public:
virtual void cal()
{
}
};
class B:public A
{
public:
void cal()
{
cout<<"Addition"<<10+20;
}
};
class C:public A
{
public:
void cal()
{
cout<<"Multiplication"<<10*20;
}
};
void main()
{
clrscr();
A *p;
B ob;
C ob1;
p=&ob;
p->cal();
p=&ob1;
p->cal();
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How can you return multiple values from a function?
Is null valid for pointers to functions?
Why is c so powerful?
Do you know the purpose of 'register' keyword?
What is 'bus error'?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
What is #define?
What is a node in c?
What is static and volatile in c?
Who developed c language?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What are the advantages and disadvantages of a heap?
What is include directive in c?
What is c value paradox explain?