JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 24
Object Oriented Programming interview questions part 24
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. If a virtual member function is defined, ___________
A. It should not contain any body and defined by subclasses
B. It must contain body and overridden by subclasses
C. It must contain body and be overloaded
D. It must not contain any body and should not be derived
Show Correct Answer
Correct Answer is :
It should not contain any body and defined by subclasses
2. Member functions of a generic class are _____________
A. Not generic
B. Automatically generic
C. To be made generic explicitly
D. Given default type as double
Show Correct Answer
Correct Answer is :
Automatically generic
3. Member function of a class can ____________
A. Access all the members of the class
B. Access only Public members of the class
C. Access only the private members of the class
D. Access subclass members
Show Correct Answer
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(); }
A. void disp::A(){ }
B. void A::disp(){ }
C. void A:disp() { cout<
D. void disp:A(){ cout<
Show Correct Answer
Correct Answer is :
void A::disp(){ }
5. A member function can _______________ of the same class
A. Call other member functions
B. Call only private member functions
C. Call only static member functions
D. Call only const member functions
Show Correct Answer
Correct Answer is :
Call other member functions
6. Which member function doesn’t require any return type?
A. Static
B. Constructor
C. Const
D. Constructor and destructor
Show Correct Answer
Correct Answer is :
Constructor and destructor
7. Which among the following is not possible for member function?
A. Access protected members of parent class
B. Definition without return type
C. Access public members of subclass
D. Access static members of class
Show Correct Answer
Correct Answer is :
Access public members of subclass
8. Which among the following are valid ways of overloading the operators?
A. Only using friend function
B. Only using member function
C. Either member functions or friend functions can be used
D. Operators can’t be overloaded
Show Correct Answer
Correct Answer is :
Either member functions or friend functions can be used
9. Which among the following is mandatory condition for operators overloading?
A. Overloaded operator must be member function of the left operand
B. Overloaded operator must be member function of the right operand
C. Overloaded operator must be member function of either left or right operand
D. Overloaded operator must not be dependent on the operands
Show Correct Answer
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 ______________
A. The right operand acts as implicit object represented by *this
B. The left operand acts as implicit object represented by *this
C. Either right or left operand acts as implicit object represented by *this
D. *this pointer is not applicable in that member function
Show Correct Answer
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?
A. Other operands are passed as function return type
B. Other operands are passed to compiler implicitly
C. Other operands must be passed using another member function
D. Other operands are passed as function arguments
Show Correct Answer
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?
A. Scope resolution operator
B. Colon
C. Arrow operator
D. Dot operator
Show Correct Answer
Correct Answer is :
Scope resolution operator
13. What is the syntax to overload an operator?
A. className::operator(parameters)
B. className:operator(parameters)
C. className.operator(paramteres)
D. className->operator(parameters)
Show Correct Answer
Correct Answer is :
className::operator(parameters)
14. Why the left parameter is removed from parameter list?
A. Because it is of no use
B. Because it is never used in definitions
C. Because it becomes parameter pointed by *this
D. Because it can’t be referred by *this pointer
Show Correct Answer
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)?
A. Left operand members
B. Right operand members
C. All operand members
D. None of the members
Show Correct Answer
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?
A. *this className
B. *this parameterObject
C. *this returnedObject
D. *this object
Show Correct Answer
Correct Answer is :
*this object
17. When the friend operator overloading is converted into member operator overloading _______________
A. Two parameters of friend function remains same parameters in member operator overloading
B. Two parameters of friend function becomes only one parameter of member function
C. Two parameters of friend function are removed while using member function
D. Two parameters of friend function are made 4 in member operator overloading
Show Correct Answer
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?
A. Right most parameter
B. Anywhere in parameter list
C. Left most parameter
D. Not added to parameter list
Show Correct Answer
Correct Answer is :
Left most parameter
19. Which operator among the following can be overloading using only member function?
A. Assignment operator
B. Addition operator
C. Subtraction operator
D. Multiplication and division operator
Show Correct Answer
Correct Answer is :
Assignment operator
20. Which operator among the following can be overloaded using both friend function and member function?
A. Assignment operator
B. Subscript
C. Member selection (arrow operator)
D. Modulus operator
Show Correct Answer
Correct Answer is :
Modulus operator
Similar Interview Questions
Search for latest jobs
Find Jobs