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
Do you know the purpose of 'register' keyword?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
Explain how do you list files in a directory?
How do I use strcmp?
Is c call by value?
How a string is stored in c?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
How can you find out how much memory is available?
What are static variables in c?
Why is c so powerful?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
How many types of functions are there in c?
Where is volatile variable stored?
What are keywords c?
What functions are used for dynamic memory allocation in c language?