C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 30)
30.
Which one of the following options is correct about the statement given below? The compiler checks the type of reference in the object and not the type of object.
Discussion:
20 comments Page 1 of 2.
Kushal baldev said:
9 years ago
Polymorphism means one name and multiple implementations.
We have two types of polymorphism early binding and late binding in early binding we are able to know at compile time but in late binding we will know at run time what actually the function will be called.
We have two types of polymorphism early binding and late binding in early binding we are able to know at compile time but in late binding we will know at run time what actually the function will be called.
(2)
Abhilasha said:
1 decade ago
If object is created run time by using base class pointer (allow to store address of any derived class)/reference and base class functions are virtual and overridden in derived class then base class pointer calls the function of derived class.
Aradhye said:
1 month ago
- Runtime polymorphism allows a base class reference or pointer to refer to a derived class object.
- But compile-time polymorphism, the compiler only sees the reference type unless the function is marked virtual.
- But compile-time polymorphism, the compiler only sees the reference type unless the function is marked virtual.
Aditya Lath said:
7 years ago
In compile Time polymorphism (i.e overloading) compiler doesn't need to check reference of an object/reference variable but in case of run-time polymorphism, it is required to check reference of Object.
(3)
Shashikant said:
1 decade ago
i think is becoz runtime polymorphism if we not mention the virtual keyword in base class then type is checked and function in the base class gets called...
Sadique rahman said:
1 decade ago
Object in polymorphism exist in many forms so it doesn't check the type of object while it will definitely check the type of reference in the object.
Keshav miglani said:
10 years ago
Wrapping means hiding and this concept used in encapsulation and abstraction but mostly this wrapping word used for encapsulation.
Samson said:
1 decade ago
Polymorphism is a example of dynamic binding so type of reference is considered on runtime.
Christian said:
1 decade ago
Is this because the object formed by polymorphism can take many forms?
Mahesh said:
9 years ago
Good explanations. Thank you all.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers