Select the statement which are correct about RTTI(Runtime type identification):
A. It allows the type of an object to be determined during program execution
B. It tells what type of object is being referred to by a base class reference determined by RTTI
C. Helps in prevention of an invalid cast exception in advance
D. All of the mentioned
Answer:A
Select the statement which are correct about RTTI(Runtime type identification):
A. It allows the type of an object to be determined during program execution B. It tells what type of object is being referred to by a base class reference determined by RTTI C. Helps in prevention of an invalid cast exception in advance D. All of the mentioned
Explanation: Runtime type identification (RTTI) allows the type of an object to be determined during program execution. RTTI is useful for many reasons .For example, we can discover precisely what type of object is being referred to by a base-class reference. Another use of RTTI is to test in advance whether a cast will succeed, preventing an invalid cast exception.