JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 53
Object Oriented Programming interview questions part 53
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 11
1. Where the virtual function should be defined?
A. Twice in base class
B. Derived class
C. Base class and derived class
D. Base class
Show Correct Answer
Correct Answer is :
Base class
2. The resolving of virtual functions is done at ______________
A. Compile time
B. Interpret time
C. Runtime
D. Writing source code
Show Correct Answer
Correct Answer is :
Runtime
3. In which access specifier should a virtual function be defined?
A. Private
B. Public
C. Protected
D. Default
Show Correct Answer
Correct Answer is :
Public
4. Virtual functions can never be made _______________
A. Static function
B. Parameterized function
C. Default argument function
D. Zero parameter function
Show Correct Answer
Correct Answer is :
Static function
5. Virtual functions can’t be made friend function of other classes.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
6. Which is must condition for virtual function to achieve runtime polymorphism?
A. Virtual function must be accessed with direct name
B. Virtual functions must be accessed using base class object
C. Virtual function must be accessed using pointer or reference
D. Virtual function must be accessed using derived class object only
Show Correct Answer
Correct Answer is :
Virtual function must be accessed using pointer or reference
7. Which among the following is true for virtual functions?
A. Prototype must be different in base and derived class
B. Prototype must be same in base class and derived class
C. Prototype must be given only in base class
D. Prototype must have different signature in base and derived class
Show Correct Answer
Correct Answer is :
Prototype must be same in base class and derived class
8. The virtual functions must be declared and defined in _____________ class and overridden in ___________ class.
A. Base, base
B. Derived, derived
C. Derived, base
D. Base, derived
Show Correct Answer
Correct Answer is :
Base, derived
9. It is __________ to redefine the virtual function in derived class?
A. Necessary
B. Not necessary
C. Not acceptable
D. Good practice
Show Correct Answer
Correct Answer is :
Not necessary
10. Which among the following is true?
A. A class may have virtual destructor but not virtual constructor
B. A class may have virtual constructor but not virtual destructor
C. A class may have virtual constructor and virtual constructor
D. A class may have either virtual destructor or virtual constructor
Show Correct Answer
Correct Answer is :
A class may have virtual destructor but not virtual constructor
11. If virtual function of base class is redefined in derived class then, ________________________
A. It must be declared virtual in derived class also
B. It may or may not be declared virtual in derived class
C. It can must not be declared virtual in derived class
D. It must be declared normally in derived class
Show Correct Answer
Correct Answer is :
It may or may not be declared virtual in derived class
Similar Interview Questions
Search for latest jobs
Find Jobs