1. If a virtual member function is defined, ___________
Correct Answer is : It should not contain any body and defined by subclasses
2. Member functions of a generic class are _____________
Correct Answer is : Automatically generic
3. Member function of a class can ____________
Correct Answer is : Access all the members of the class
4. Which among the following is proper syntax for class given below?
class A
{
int a,b;
public : void disp();
}
Correct Answer is : void A::disp(){ }
5. A member function can _______________ of the same class
Correct Answer is : Call other member functions
6. Which member function doesn’t require any return type?
Correct Answer is : Constructor and destructor
7. Which among the following is not possible for member function?
Correct Answer is : Access public members of subclass
8. Which among the following are valid ways of overloading the operators?
Correct Answer is : Either member functions or friend functions can be used
9. Which among the following is mandatory condition for operators overloading?
Correct Answer is : Overloaded operator must be member function of the left operand
10. When the operator to be overloaded becomes the left operand member then ______________
Correct Answer is : The left operand acts as implicit object represented by *this
11. If the left operand is pointed by *this pointer, what happens to other operands?
Correct Answer is : Other operands are passed as function arguments
12. If a friend overloaded operator have to be changed to member overloaded operator, which operator should be used with the class name?
Correct Answer is : Scope resolution operator
13. What is the syntax to overload an operator?
Correct Answer is : className::operator(parameters)
14. Why the left parameter is removed from parameter list?
Correct Answer is : Because it becomes parameter pointed by *this
15. Which object’s members can be called directly while overloading operator function is used (In function definition)?
Correct Answer is : Left operand members
16. If left operand member is specified directly in the function definition, which is the correct implicit conversion of that syntax?
Correct Answer is : *this object
17. When the friend operator overloading is converted into member operator overloading _______________
Correct Answer is : Two parameters of friend function becomes only one parameter of member function
18. Where in the parameter list is the implicit *this is added?
Correct Answer is : Left most parameter
19. Which operator among the following can be overloading using only member function?
Correct Answer is : Assignment operator
20. Which operator among the following can be overloaded using both friend function and member function?
Correct Answer is : Modulus operator