Which of the following can be virtual?
a) Constructors
b) Destructors
c) Ordinary functions
d) Friend functions
e) Static functions
b) Destructors , and c) Ordinary functions
Part a) is wrong. The virtual keyword may not be applied to any constructor. Part d) is wrong. Functions that are friends cannot be virtual, since they are not class members. Part e) is wrong. The fact that virtual functions are called through an object contradicts the function’s static nature. (A static function is associated with the class, not any object).
You might also like to view...
Which of the following is NOT a guideline you should follow to avoid damage to circuit boards during installation?
A. leave the card in its protective cover B. be sure you are on a carpeted floor C. disconnect all power to the computer D. touch a grounded part to discharge static
What file lists the permissions needed to access other Android functions required by your app?
A. styles.xml B. AndroidManifest.xml C. activity_main.xml D. Strings.xml