Cpp Programming 78 – Which of the following provides a reuse mechanism?
[B]. Inheritance[C]. Dynamic binding
[D]. Encapsulation
Answer: Option B
Answer: Option B
Answer: Option B
Explanation:
The two main types of polymorphism are run-time (implemented as inheritance and virtual functions), and compile-time (implemented as templates).
The program will print the output Bix.
[C].
The program will print the output IndiaBix.
[D].
The program will report compile time error.
Answer: Option C
Explanation:
No answer description available for this question.
[A].
Only 1 is correct.
[B].Only 2 is correct.
[C].
Both 1 and 2 are correct.
[D].
Both 1 and 2 are incorrect.
Answer: Option D
Explanation:
No answer description available for this question.
#include
class IndiaBix
{
static int x;
public:
static void SetData(int xx)
{
this->x = xx;
}
static void Display()
{
cout<< x ;
}
};
int IndiaBix::x = 0;
int main()
{
IndiaBix::SetData(22);
IndiaBix::Display();
return 0;
}
[A].The program will print the output 0.
[B].The program will print the output 22.
[C].The program will print the output Garbage.
[D].The program will report compile time error.
Answer: Option D
Answer: Option A
Answer: Option B