C++ Programming - OOPS Concepts - Discussion

Discussion :: OOPS Concepts - General Questions (Q.No.36)

36. 

Which of the following is a mechanism of static polymorphism?

[A]. Operator overloading
[B]. Function overloading
[C]. Templates
[D]. All of the above

Answer: Option D

Explanation:

No answer description available for this question.

Paras Santoki said: (Sep 20, 2012)  
How Template achieve the static polymorphism can any explain?

Ashish said: (Sep 15, 2013)  
I also have same doubt because template is a mechanism which is achieve through dynamic polymorphism.

Nilay Vishwakarma said: (Nov 25, 2013)  
This is static(compile time) polymorphism., same code for any type.

template<class XYZ>
XYZ large(XYZ a, XYZ b)
{
if(a>b)return a;
else return b;
return a;
}
int main()
{
string str1("Nilay"),str2("IndiaBIX")
cout<<large(10,20)<<"\n";
cout<<max(str1,str2);
return 0;
}

Payal said: (Feb 14, 2014)  
How can template mechanism of static polymorphism? please explain in brief.

Akash said: (Nov 10, 2014)  
Why Template?

Priya said: (Jul 17, 2015)  
What is meant by static polymorphism?

Qwe said: (Aug 17, 2015)  
What is static polymorphism?

Radhika said: (Aug 19, 2015)  
Explain it in brief?

Bharat said: (Sep 17, 2015)  
What are templates?

Mohammed said: (Aug 2, 2016)  
What is dynamic polymorphism?

Shreyas Deshpande said: (Aug 7, 2016)  
What is static polymorphism?

Mounika said: (Oct 16, 2016)  
If we define a function as a template function, it can work with different data types and if a class is made as a template, its members can be of any data type. Data types of members are given at the time of creating the object.

Nikhil said: (Jan 7, 2018)  
I mean templates allso comes in static binding so all of the above.

Sushil Nirmale said: (Aug 21, 2018)  
I think Template comes under dynamic binding.

Yash Jaiswal said: (Jan 31, 2019)  
What is meant by template?

Lahari said: (Feb 23, 2020)  
To avoid the overloading we use templates.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.