BSCS 7 A Final MCQS
BSCS 7 A Final MCQS
a) Makes all members of the base class private in the derived class
b) Keeps all members of the base class public in the derived class
c) Converts private members to public in the derived class
d) Does not affect the access specifiers of the base class
a) Public
b) Private
c) Protected
d) Default
a) Public
b) Private
c) Protected
d) None
a) Yes
b) No
c) Only in public inheritance
d) Only in protected inheritance
a) Protected
b) Private
c) Public
d) None
14. Which inheritance type allows members of the base class to be
accessed only within the derived class hierarchy?
a) Public
b) Private
c) Protected
d) Static
17. If a base class has public members and the derived class inherits it
privately, how are these members treated in the derived class?
a) Public
b) Protected
c) Private
d) Inaccessible
18. What kind of inheritance allows the derived class to directly access
base class protected members?
a) Public inheritance
b) Private inheritance
c) Protected inheritance
d) Multiple inheritance
a) Public
b) Private
c) Protected
d) Default
a) Private members
b) Public and protected members
c) Public members only
d) None of the above
23. In public inheritance, who can access the public members of the
base class?
24. In which type of inheritance does the derived class restrict access
to base class members?
a) Public
b) Private
c) Protected
d) Static
a) Yes
b) No
c) Only in public inheritance
d) Only in protected inheritance
26. In C++, which inheritance type keeps base class members hidden
from the outside but accessible within the derived class?
a) Public
b) Protected
c) Private
d) Static
27. What happens to public members of a base class when the derived
class inherits privately?
a) Public inheritance
b) Private inheritance
c) Protected inheritance
d) None of the above
29. In private inheritance, can the derived class object access public
members of the base class directly?
a) Yes
b) No
c) Only if they are friend functions
d) Only through public inheritance
a) Yes
b) No
c) Only through a friend function
d) Only if they are static members
32. Can a derived class override a public function of the base class in
C++?
a) Yes, always
b) No, never
c) Only if it is inherited privately
d) Only if the function is virtual
33. In C++, which of the following inheritance types allows further
inheritance of base class members?
a) Public
b) Protected
c) Private
d) Both a and b
a) Public
b) Protected
c) Private
d) Default
a) Public
b) Private
c) Protected
d) None
a) Yes, always
b) No, never
c) Only through public inheritance
d) Only if the base class grants friend access
38. When a base class is inherited publicly, what happens to its private
members?
a) Public
b) Private
c) Protected
d) Multiple
45. How does the compiler treat ambiguous base class members in
multiple inheritance?
a) Selects the first base class’s member
b) Causes a compilation error
c) Resolves ambiguity automatically
d) Allows the programmer to explicitly specify the base class
a) Public inheritance
b) Private inheritance
c) Multiple inheritance
d) Virtual inheritance
a) Prevents inheritance
b) Resolves ambiguity in multiple inheritance
c) Converts base class members to public
d) Allows access to private members of the base class
50. In which inheritance type are base class members not accessible
outside the derived class?
a) Public inheritance
b) Protected inheritance
c) Private inheritance
d) Virtual inheritance
4. In function overloading, can two functions differ only by their return type?
a) Yes
b) No
cpp
CopyEdit
void func(int a);
void func(float b);
a) Correct
b) Incorrect
16. What happens if a derived class function hides a base class function without overriding
it?
a) Base class function is inaccessible
b) Derived class function is always called
c) Base class function is still accessible using scope resolution
d) Both b and c
17. Which access specifier must be used for a base class function to allow overriding?
a) private
b) protected
c) public or protected
d) None of the above
35. Which of the following code snippets demonstrates function overloading in C++?
cpp
CopyEdit
a) Correct implementation
b) Incorrect implementation
42. In C++, overriding a function requires the base class function to be declared as:
a) private
b) final
c) virtual
d) static
46. If you want to prevent a method from being overridden in Java, use the keyword:
a) override
b) static
c) final
d) sealed
49. Which C++ feature allows overriding but ensures the base class method is accessible?
a) protected keyword
b) Scope resolution operator ::
c) final keyword
d) private keyword
MCQ’s Key
1. a 2. b 3. b 4. b 5. a
6. b 7. c 8. a 9. b 10. c
11. b 12. b 13. b 14. a 15. a
16. d 17. c 18. a 19. b 20. c
21. b 22. b 23. c 24. c 25. b
26. a 27. b 28. c 29. c 30. b
31. b 32. c 33. b 34. c 35. a
36. d 37. b 38. b 39. a 40. a
41. b 42. c 43. d 44. b 45. a
46. c 47. c 48. b 49. b 50. b
Topic: Static and Dynamic Binding
class C : public B {
public:
void func() override {}
};
a) Class B cannot be instantiated, but class C can be instantiated.
b) Both B and C can be instantiated.
c) Neither B nor C can be instantiated.
d) Class B can be instantiated, but class C cannot be instantiated.
56. What will the following code produce?
class Base {
public:
virtual void func1() { cout << "Base func1\n"; }
virtual void func2() { cout << "Base func2\n"; }
};
int main() {
Base* b = new Derived();
b->func1();
b->func2();
return 0;
}
a) Derived func1
Base func2
b) Base func1
Derived func2
c) Compilation error
d) Derived func1
Derived func2
57. What happens when the following code is executed?
class A {
public:
void show() { cout << "A Show\n"; }
};
class B : public A {
public:
void show() { cout << "B Show\n"; }
};
int main() {
A* a = new B();
a->show();
return 0;
}
a) A Show
b) B Show
c) Undefined behavior
d) Compilation error
58. What happens when you redefine a virtual function without using the override
keyword in a derived class?
a) A compile-time error occurs.
b) The function will still be dynamically bound, but warnings may be issued.
c) The function will be treated as statically bound, ignoring the virtual nature.
d) The base class function remains pure virtual.
59. Which of the following is an incorrect statement about overriding and redefining in
C++?
a) Redefining a function in the derived class hides the base class function.
b) Overriding requires the base class function to be declared as virtual.
c) Overridden functions can have different function signatures between base and derived
classes.
d) Redefining is resolved based on the static type of the object.
60. What is a potential downside of using dynamic binding in large systems?
a) It complicates the implementation of inheritance hierarchies.
b) It reduces the reusability of code.
c) It can make debugging more difficult because the exact function called is determined at
runtime.
d) It forces the use of static functions.
MCQ’s Key
1 b 7 b 13 c 19 c 25 a
2 b 8 d 14 c 20 b 26 c
3 b 9 a 15 c 21 b 27 a
4 d 10 b 16 c 22 d 28 c
5 c 11 a 17 c 23 b 29 c
6 a 12 c 18 b 24 b 30 b
31 b 37 b 43 b 49 a 55 a
32 b 38 c 44 b 50 a 56 a
33 c 39 b 45 b 51 c 57 a
34 b 40 c 46 a 52 b 58 b
35 c 41 b 47 c 53 b 59 c
36 b 42 b 48 a 54 d 60 c
7. If a derived class does not override a pure virtual function of the base class, what
happens?
a) It becomes an abstract class itself
b) It gets an error at runtime
c) It runs without any issue
d) It throws a compiler warning
12. If an abstract class has multiple pure virtual functions, what must a derived class
do to become concrete?
a) Override at least one function
b) Override all pure virtual functions
c) Provide a constructor
d) Inherit another abstract class
class Base {
virtual void display() = 0;
};
a) Correct
b) Incorrect
17. If a pure virtual function is overridden in a derived class, what must be done for
proper object destruction?
a) The base class destructor should be virtual
b) The derived class destructor should be virtual
c) Nothing special is required
d) The function must be declared as final
20. How can a class be made abstract without defining any pure virtual function?
a) Declare the destructor as pure virtual
b) Declare all functions as private
c) Use the abstract keyword
d) Declare at least one function as static
22. What happens if a derived class does not implement all pure virtual functions of
the base class?
a) The derived class becomes abstract
b) The program runs with warnings
c) Compilation error
d) It causes undefined behavior
23. If a derived class provides its own version of a pure virtual function, what
happens to the base class reference pointing to the derived class object?
a) Calls the base class function
b) Calls the derived class function
c) Compilation error
d) Causes undefined behavior
26. How many pure virtual functions must a class have to be considered abstract?
a) At least one
b) At least two
c) Exactly three
d) None
27. What is the advantage of using abstract classes?
a) Provides a common interface for derived classes
b) Increases compilation speed
c) Reduces code size
d) Prevents multiple inheritance
29. If a class A is abstract and class B inherits from A, but does not override all
pure virtual functions, what happens?
a) Class B also becomes abstract
b) Class B runs without any issue
c) Class B cannot be instantiated
d) Both a and c
32. If a class inherits from two abstract classes, what must it do?
a) Implement all pure virtual functions from both classes
b) Implement only one function
c) Cannot be inherited
d) None of the above
34. If an abstract class has an implemented method, can it be called from a derived class?
a) Yes
b) No
37. Can a constructor of a derived class call the constructor of an abstract base class?
a) Yes
b) No
38. What happens if a pure virtual function has a definition in the abstract class?
a) The function must be overridden
b) The function can be called by derived classes
c) The function behaves as a normal virtual function
d) All of the above
class
Base
{ pub
lic:
virtual void show() = 0;
};
class Derived : public Base
{ public:
void show() { cout << "Derived"; }
};
int main()
{ Derived
d;
d.show();
}
a) Error
b) Derived
c) Base
d) Undefined
42. How do you call a pure virtual function inside a base class constructor?
a) It is not possible
b) Using this->function()
c) Using Base::function()
d) Using a derived class object
44. Can a non-abstract class inherit from an abstract class without implementing its
pure virtual functions?
a) No
b) Yes
47. What happens when a base class with a pure virtual destructor is deleted via a
base class pointer?
a) Calls only the base class destructor
b) Calls the derived class destructor first
c) Causes memory leak
d) Results in undefined behavior
51. A class is made abstract by declaring at least one of its functions as?
a) impure virtual function
b) pure virtual function
c) pure abstract function
d) impure abstract function
a) TRUE
b) FALSE
c) Can be true and false
d) Can not say
MCQS KEY
1 B 11 A 21 A
2 B 12 B 22 A
3 A 13 A 23 B
4 C 14 A 24 B
5 D 15 A 25 A
6 A 16 B 26 A
7 A 17 A 27 A
8 D 18 A 28 A
9 B 19 A 29 D
10 C 20 A 30 A
31 A 41 A 51 B
32 A 42 A 52 B
33 A 43 A 53 A
34 A 44 A 54 D
35 B 45 A 55 A
36 C 46 A 56 A
37 A 47 B 57 A
38 D 48 A 58 B
39 B 49 A 59 C
40 D 50 A 60 C
Topic: Inheritance
1. Which of the following is the correct syntax for inheriting a class in C++?
2. What is the default access specifier for members of a class inherited using
private inheritance?
a) Private
b)Public
c) Protected
d) Default
3. In C++, a derived class can access which members of its base class?
a) Private
b) Public
c) Protected
d) Both b and c
a) Single Inheritance
b) Multiple Inheritance
c) Multilevel Inheritance
d) Restricted Inheritance
6. If a derived class does not have a constructor, which constructor of the base class
is called?
a)Default constructor
b) Parameterized constructor
c) Copy constructor
d) None of the above
7. Which access specifier will be used by default when inheriting a class in C++?
a) Public
b)Private
c) Protected
d) Default
8. Which keyword is used to create a derived class from a base class in C++?
a) extend
b) inherits
c) class
d) :
9. If a class is derived privately, what type of access will its members have in the
derived class?
a)Private
b) Public
c) Protected
d) None of the above
11. Which of the following constructors will be called when a derived class object is
created?
16. Which of the following will allow a derived class to access protected members of
the base class?
a) Private inheritance
b)Public inheritance
c) Protected inheritance
d) All of the above
18. If a class is inherited privately, what happens to the public members of the base
class?
20. What happens when a class is inherited in C++ using protected inheritance?
21. Can a derived class in C++ modify the behavior of a function defined in the base
class?
22. What will happen if a constructor is not explicitly called in a derived class?
24. What is the order in which constructors are called in case of multiple
inheritance in C++?
a) Constructor of the last base class followed by the constructor of the derived class
b)Constructor of the base classes followed by the constructor of the
derived class
c) Constructor of the derived class followed by the constructors of the base classes
d) The constructor of the derived class is never called
25. Which of the following best describes the concept of "is-a" relationship in
inheritance?
a)It means a derived class can be considered a type of its base class
b) It means a derived class has no relation to the base class
c) It represents a "has-a" relationship
d) It does not apply in C++
26. Which keyword is used to access members of a base class inside a derived class
in C++?
a) this
b) super
c) base
d) ::
27. What is the default visibility of members in a class derived using protected
inheritance?
a) Private
b)Protected
c) Public
d) None of the above
28. If you want to prevent a derived class from overriding a function, which
keyword should be used in the base class?
a) final
b) override
c) virtual
d) static
a) Multiple Inheritance
b)Multilevel Inheritance
c) Hybrid Inheritance
d) Single Inheritance
32. In C++, what is the output of a program if a base class constructor is not
called explicitly by the derived class?
a) A constructor of a derived class can call the constructor of the base class
b)The destructor of the base class is not called after the derived class
destructor
c) The constructor of the derived class does not need to call the base class constructor
d) The base class destructor should be virtual if dynamic memory is allocated
a) The destructor of the derived class is called before the destructor of the base class
b) Destructors in derived classes are always virtual
c)The base class destructor is called after the derived class destructor
d) Destructor calls in inheritance depend on the access modifier
35. What happens when the same function is defined in both base and derived
classes?
36. If a class contains only private members and methods, what happens if it is
inherited publicly?
a)The private members of the base class remain private in the derived
class
b) The private members of the base class are accessible in the derived class
c) The private members of the base class are inherited as public
d) The inheritance will fail
37. What is the correct syntax to create a derived class that inherits publicly
from two base classes in C++?
39. Which function is used to dynamically allocate memory for a class object in C+
+?
a) new
b) malloc
c) delete
d) alloc
a) final
b) private
c) static
d) override
a)Yes
b) No
c) Only if it is public
d) Only if it is protected
44. In C++, the base class constructor is always called first before the derived class
constructor when an object of the derived class is created. True or False?
a)True
b) False
a)Public members of the base class are private in the derived class
b) The derived class cannot access the private members of the base class
c) The base class constructor is not called
d) The derived class can access protected members of the base class
47. Can a derived class have a constructor that calls the constructor of the base class
explicitly?
a)Yes
b) No
48. What happens when the same function is defined in both base and derived
classes?
49. Which access specifier makes members of the base class accessible to the
derived class and all other classes?
a) Private
b) Protected
c)Public
d) None of the above
50. What is the purpose of using the virtual keyword with a base class method?
a) Single Inheritance
b)Multiple Inheritance
c) Multilevel Inheritance
d) Hybrid Inheritance
a) Functions
b) Constructors
c)Destructors
d) Static members
55. Can a constructor in a derived class explicitly call the constructor of the base
class?
a)Yes
b) No
56. Which of the following ensures that only one instance of a base class is
inherited in multiple inheritance?
a)Virtual inheritance
b) Static inheritance
c) Protected inheritance
d) Private inheritance
57. Which keyword is used to refer to the base class in the derived class?
a) super
b) this
c) base
d) ::
58. Which of the following is a valid access specifier for base class members in
derived classes?
a) protected
b) private
c) public
d) All of the above
59. Which of the following defines the relationship between a base class and
derived class in C++?
60. In the context of inheritance, which relationship is described by the phrase "is-
a"?
MCQ’S Key
1 a 11 b 21 a 31 b 41 b 51 b
2 b 12 a 22 a 32 a 42 a 52 a
3 d 13 b 23 a 33 b 43 b 53 b
4 b 14 a 24 b 34 c 44 a 54 c
5 d 15 a 25 a 35 b 45 b 55 a
6 a 16 b 26 c 36 a 46 a 56 a
7 b 17 a 27 b 37 b 47 a 57 c
8 d 18 a 28 a 38 a 48 b 58 a
9 a 19 c 29 a 39 a 49 c 59 a
10 a 20 a 30 b 40 a 50 a 60 a
a) public
b) private
c) protected
d) There is no specific keyword for multiple inheritance
3. In multiple inheritance, if two base classes have a member function with the same
name, which function does the derived class call?
a) The function from the first base class
b) The function from the second base class
c) Both functions will be called
d) The compiler will throw an error
a) Constructor conflicts
b) Diamond problem
c) Method overloading
d) Memory inefficiency
5. Which of the following is true about multiple inheritance?
7. Which of the following is the correct syntax for multiple inheritance in C++?
8. If a class is derived from two base classes in C++, how many times will the constructor
of the base class be called?
a) Once
b) Twice
c) Three times
d) Only when explicitly called
9. In multiple inheritance, if two base classes have a member with the same name,
the derived class must:
a) Rename one of the members
b) Use scope resolution to call the correct member
c) Remove one of the members
d) Inherit both members without any issues
10. What will happen if you try to access a member variable of the base class directly
in multiple inheritance without using scope resolution?
a) It will access the first base class member variable
b) It will access the second base class member variable
c) The compiler will generate an error
d) The program will run without any issues
a) Two
b) Three
c) Any number of levels
d) Only two levels are allowed
13. In multi-level inheritance, the derived class at the deepest level can access members
of which classes?
a) Only the base class at the top level
b) Only its immediate base class
c) All classes in the inheritance chain
d) Only the last class in the chain
14. Which of the following is true in multi-level inheritance?
16. In multi-level inheritance, if the base class has a destructor, which class's destructor
is called first when the derived class object goes out of scope?
a) The base class's destructor
b) The immediate base class's destructor
c) The derived class's destructor
d) The compiler chooses which destructor to call
18. Can a class inherit from multiple classes in a multi-level inheritance scenario in C++?
19. In multi-level inheritance, what happens if a member is not defined in the derived class?
a) The derived class will inherit the member from the parent class
b) The derived class will ignore the member
c) The derived class will cause a compilation error
d) The derived class will access the member from the most distant ancestor class
a) class Derived : public Base1 {}; class Derived2 : public Derived {};
b) class Derived : public Base {}; class Derived2 {};
c) class Derived : public Base1, Base2 {};
d) class Derived {}; class Derived2 : public Derived {};
21. What happens in a program where both multiple and multi-level inheritance are used?
22. In multiple and multi-level inheritance, which class's constructor is called first?
23. When using both multiple and multi-level inheritance, which of the following is
true about accessing inherited members?
a) The member from the most derived class is always accessed
b) The member from the immediate base class is always accessed
c) The compiler can get confused about which base class to use
d) There is no way to access inherited members
24. Which of the following is a potential drawback of combining multiple and multi-level
inheritance in C++?
a) The code becomes simpler and easier to maintain
b) There can be ambiguity when accessing members or functions
c) It always leads to faster execution
d) It makes the program easier to debug
25. In a situation where a derived class uses both multiple and multi-level
inheritance, which constructor is called last?
a) The constructor of the most base class
b) The constructor of the most derived class
c) The constructor of the immediate base class
d) The constructor of the second derived class
26. Which type of inheritance allows a derived class to inherit from more than one
base class?
a) Single Inheritance
b) Multiple Inheritance
c) Multilevel Inheritance
d) Hierarchical Inheritance
28. Which of the following inheritance types forms a hierarchy of classes where a derived
class inherits from a base class, and then another derived class inherits from that
derived class?
a) Multiple Inheritance
b) Hierarchical Inheritance
c) Multilevel Inheritance
d) Hybrid Inheritance
29. Which inheritance type combines multiple inheritance and multilevel inheritance?
a) Single Inheritance
b) Hybrid Inheritance
c) Multiple Inheritance
d) Multilevel Inheritance
a) Code duplication
b) Ambiguity
c) Slow execution
d) Memory leakage
a) Constructor
b) Virtual Inheritance
c) Destructor
d) Destructor Overloading
32. Which keyword is used to denote a derived class inheriting from two base classes in
C++?
a) public
b) virtual
c) friend
d) private
c
l
a
s
s
A
{
p
u
b
li
c
:
void show() { cout << "A"; }
};
class B : public A
{}; class C :
public A {};
class D : public B, public
C {}; int main() {
D obj;
obj.show();
}
a) A
b) B
c) C
d) Compilation error due to ambiguity
34. Which type of inheritance involves a derived class being derived from one base
class, and then another class being derived from the first derived class?
a) Multilevel Inheritance
b) Multiple Inheritance
c) Hierarchical Inheritance
d) Hybrid Inheritance
a) One
b) Two
c) Two or More than two
d) It depends on the programmer
a) It prevents ambiguity.
b) It enables the derived class to combine the functionality of multiple base classes.
c) It makes the code less complex.
d) It improves memory usage.
a) Inheritance allows a class to acquire properties and behaviors from another class.
b) Multilevel inheritance occurs when a class inherits from more than one class.
c) In C++, multiple inheritance is supported but should be used carefully.
d) Inheritance can help in code reuse and organization.
42. What happens when two classes are derived from a common base class, and a third
class is derived from both of them in C++?
a) Virtual inheritance resolves ambiguity automatically.
b) The derived class may face ambiguity issues.
c) The derived class inherits only from one class.
d) Only the first derived class is inherited.
45. Which of the following inheritance types would be most appropriate for a
scenario where one class represents a basic entity, and another class builds on that
entity with additional properties or behaviors?
a) Single Inheritance
b) Multiple Inheritance
c) Multilevel Inheritance
d) Hybrid Inheritance
a) class A : public B { };
b) class A : public B, public C { };
c) class A : public B, private C { };
d) class A : private B { };
MCQ’s Key
1 a 11 b 21 b 31 b 41 b
2 d 12 c 22 b 32 b 42 b
3 d 13 c 23 c 33 d 43 b
4 b 14 b 24 b 34 a 44 b
5 b 15 b 25 b 35 d 45 c
6 b 16 c 26 b 36 c 46 b
7 a 17 d 27 b 37 c 47 b
8 b 18 b 28 c 38 b 48 a
9 b 19 a 29 b 39 b 49 a
10 c 20 a 30 b 40 c 50 a
5. What happens if a virtual function is called using a base class pointer that points to
a derived class object?
a) Base class function is always called
b) Derived class function is called if it overrides the base function
c) Compilation error occurs
d) Runtime error occurs
12. What happens if a class has a virtual function but no virtual destructor?
a) The program does not compile
b) Derived class objects may not be properly deleted
c) All virtual functions become non-virtual
d) The base class cannot be inherited
13. What is the size of an object of a class that contains only a virtual function
(assuming no other members)?
a) 0 bytes
b) 4 bytes (or 8 bytes in 64-bit systems)
c) 1 byte
d) 2 bytes
19. Which of the following is true about virtual functions in multiple inheritance?
a) Each base class maintains its own vtable
b) Only one vtable is created for all base classes
c) Virtual functions cannot be used in multiple inheritance
d) Virtual functions cause compilation errors in multiple inheritance
23. What happens if a derived class does not override a virtual function?
a) Compilation error occurs
b) The base class version is used
c) The derived class cannot be instantiated
d) Runtime error occurs
24. Which of the following must be declared as virtual to achieve runtime polymorphism?
a) Constructor
b) Member function
c) Destructor
d) Static function
25. What is the output of calling a virtual function from a base class pointer pointing to
a derived class object?
a) Base class version is always called
b) Derived class version is called if overridden
c) Compilation error occurs
d) The program crashes
30. Can a virtual function have a default implementation in the base class?
a) Yes
b) No
c) Only if declared as pure virtual
d) Only if the derived class does not override it
32. Which of the following is true about virtual functions and inheritance?
a) A virtual function in a base class can be overridden in a derived class
b) Virtual functions cannot be inherited
c) Virtual functions must always be overridden
d) A virtual function can only be used in single inheritance
35. What happens if a base class has a virtual function and a derived class redefines it
without using virtual?
a) The function remains virtual in the derived class
b) The function loses its virtual property in the derived class
c) Compilation error occurs
d) The program crashes at runtime
36. Can a pure virtual function have an implementation in the base class?
a) Yes
b) No
c) Only in final classes
d) Only if the derived class does not override it
37. What is the main difference between a virtual function and a non-virtual function?
a) Virtual functions support dynamic binding, while non-virtual functions use static binding
b) Virtual functions cannot be overridden
c) Non-virtual functions are always faster
d) Virtual functions must be static
38. If a derived class does not provide an override for a pure virtual function, what
happens?
a) The program does not compile
b) The base class version is used
c) The function is ignored
d) The function remains uninitialized
41. Can a derived class override a virtual function and make it non-virtual?
a) No, once declared virtual, it remains virtual in derived classes
b) Yes, by removing the virtual keyword
c) Only if the base class allows it
d) Only if using private inheritance
44. How does C++ ensure proper destruction of objects with virtual functions?
a) Using virtual destructors
b) Using function pointers
c) Using static functions
d) Using friend functions
47. Which of the following statements is true about virtual functions and inline functions?
a) Virtual functions cannot be inlined
b) Inline functions cannot be virtual
c) Virtual functions can be inlined but are resolved at runtime
d) Inline functions are resolved at runtime
1 a 11 b 21 c 31 a 41 a
2 c 12 b 22 c 32 a 42 a
3 c 13 b 23 b 33 b 43 a
4 c 14 b 24 b 34 b 44 a
5 b 15 b 25 b 35 b 45 b
6 b 16 c 26 b 36 a 46 a
7 a 17 a 27 b 37 a 47 c
8 a 18 b 28 a 38 a 48 a
9 d 19 a 29 a 39 a 49 a
10 b 20 a 30 a 40 a 50 a