Which of the following statements are correct about the C#.NET code snippet given below?
[A].
[B].
[C].
[D].
Answer: Option A
Explanation:
No answer description available for this question.
[B].
[C].
[D].
Answer: Option A
Explanation:
No answer description available for this question.
#include
#include
class BixString
{
char x[50];
char y[50];
char z[50];
public:
BixString()
{ }
BixString(char* xx)
{
strcpy(x, xx);
strcpy(y, xx);
}
BixString(char *xx, char *yy = " C++", char *zz = " Programming!")
{
strcpy(z, xx);
strcat(z, yy);
strcat(z, zz);
}
void Display(void)
{
cout<< z << endl;
}
};
int main()
{
BixString objStr("Learn", " Java");
objStr.Display();
return 0;
}
[A].Java Programming!
[B].C++ Programming!
[C].Learn C++ Programming!
[D].Learn Java Programming!
Answer: Option D
Answer: Option C
#include
class BixData
{
int x, y, z;
public:
BixData(int xx, int yy, int zz)
{
x = ++xx;
y = ++yy;
z = ++zz;
}
void Show()
{
cout<< "" << x++ << " " << y++ << " " << z++;
}
};
int main()
{
BixData objData(1, 2, 3);
objData.Show();
return 0;
}
[A].The program will print the output 1 2 3.
[B].The program will print the output 2 3 4 .
[C].The program will print the output 4 5 6.
[D].The program will report compile time error.
Answer: Option B
are inherited
[C].
are not called
[D].
are created
Answer: Option C
Explanation:
No answer description available for this question.
#include
class BixBase
{
int x, y;
public:
BixBase(int xx = 10, int yy = 10)
{
x = xx;
y = yy;
}
void Show()
{
cout<< x * y << endl;
}
};
class BixDerived
{
private:
BixBase objBase;
public:
BixDerived(int xx, int yy) : objBase(xx, yy)
{
objBase.Show();
}
};
int main()
{
BixDerived objDev(10, 20);
return 0;
}
[A].The program will print the output 100.
[B].The program will print the output 200.
[C].The program will print the output Garbage-value.
[D].The program will report compile time error.
Answer: Option B
#include
class BixBase
{
public:
BixBase()
{
cout<< "Base OK. ";
}
};
class BixDerived: public BixBase
{
public:
BixDerived()
{
cout<< "Derived OK. ";
}
~BixDerived()
{
cout<< "Derived DEL. ";
}
};
int main()
{
BixBase objB;
BixDerived objD;
objD.~BixDerived();
return 0;
}
[A].Base OK. Derived OK. Derived DEL.
[B].Base OK. Base OK. Derived OK. Derived DEL.
[C].Base OK. Derived OK. Derived DEL. Derived DEL.
[D].Base OK. Base OK. Derived OK. Derived DEL. Derived DEL.
Answer: Option D