Which of the following can be overloaded?
Which of the following means "The use of an object of one class in definition of another class"?
Which of the following is the only technical difference between structures and classes in C++?
Which of the following statements is correct about the program given below?
class Bix
{
public:
static void MyFunction();
};
int main()
{
void(*ptr)() = &Bix::MyFunction;
return 0;
Which of the following statements are correct for a static member function?
It can access only other static members of its class.
It can be called using the class name, instead of objects.
Default value of static variable is_____ .
By default, members of the class are ____________ in nature.
class TEST
{
private:
int roll_no;
public:
int age;
char name[20];
private:
int grade;
protected:
char gender[20];
private:
private:
int m1, m2, m3;
};
In general view, is this class definition valid?
If a program uses Inline Function, then the function is expanded inline at ___________.
Static variable in a class is initialized when _____ .
C structure differs from CPP class in regards that by default all the members of the structure are __________ in nature.
State True or False.
i) A satic function can have access to only other static members (functions or variables) declared in the same class.
ii) A static member function can be called using the class name (instead of its objects)
Which of the following is/ are the characteristics of friend function.
What does your class can hold?
How many specifiers are present in access specifiers in class?
1
2
3
4
SHOW ANSWERWhich is used to define the member of a class externally?
Which other keywords are also used to declare the class other than class?
What is the output of this program?
#include <iostream>
using namespace std;
class rect
{
int x, y;
public:
void val (int, int);
int area ()
{
return (x * y);
}
};
void rect::val (int a, int b)
{
x = a;
y = b;
}
int main ()
{
rect rect;
rect.val (3, 4);
cout << "rect area: " << rect.area();
return 0;
}