-
What is the output of this program?
#include <iostream>
using namespace std;
template <class type>
class Example
{
public:
Example();
~Example();
type Data(type);
};
template <class type>
type Example<type>::Data(type Value0)
{
return Value0;
}
template <class type>
Example<type>::Example()
{
}
template <class type>
Example<type>::~Example()
{
}
int main(void)
{
Example<char> Value1;
cout << Value1.Data('L') << endl;
return 0;
}
-
- Compilation Error
- Runtime Error
- Garbage Value
- L
- None of these
Correct Option: D
In this program, We are passing the values and printing it by using template inheritance.