Answer the following statements true (T) or false (F)
1) An interface cannot declare any instance variables.
2) Establishing the relationship between a listener and the component it listens to is accomplished using polymorphism.
3) A reference variable can refer to an object of a child class, but not any further down the inheritance hierarchy.
4) Polymorphism via inheritance requires that all classes in the inheritance hierarchy are concrete.
5) An interface name may be used as a reference type.
1) T
2) T
3) F
4) F
5) T
You might also like to view...
Given the following simplified classes,
class Pet { public: virtual void print(); string name; private: }; class Dog: public Pet { public: void print(); string breed; }; Dog vDog; Pet vPet; vDog.name="rover"; vDog.breed = "Collie"; Which of the following statements are not legal? a. vPet=vDog; cout << vDog.name; b. vPet=vDog; cout << vDog.breed; c. vPet=vDog; cout << vPet.name; d. vPet=vDog; cout << vPet.breed;
A __________ vulnerability scanner listens in on the network and identifies vulnerable versions of both server and client software.
A. passive B. aggressive C. active D. secret