If a base class and a derived class each include a member function with the same name, the member function of the derived class will be called by an object of the derived class
A:
True
B:
False
C:
D:
Answer:A
This is because the member functions are always searched in the derived class and then in the base class.
Discuss About this Question.
If a base class contains a member function func(), and a derived class does not contain a function with this name, an object of the derived class cannot access func().
A:
True
B:
False
C:
D:
Answer:B
It depends upon how the function func() has been defined in the base class. If the function func() is defined public in base class then an object of the derived class can access the function func().
Discuss About this Question.
We can derive a class from a base class even if the base class's source code is not available.
A:
True
B:
False
C:
D:
Answer:A
We can derive from a base class even if it is present in an assembly.
Discuss About this Question.
There is no private or protected inheritance in C#.NET.
The way a derived class member function can access base class public members, the base class member functions can access public member functions of derived class.
A:
True
B:
False
C:
D:
Answer:B
Base class cannot access derived class members since it does not have any knowledge of the derived class.
Discuss About this Question.
Ad Slot (Above Pagination)
Install ExamAdept
Fast access — add this app to your device.
To install on iPhone/iPad: tap Share → Add to Home Screen.
Discuss About this Question.