Answer Posted / ravinandan
Template is used for generic programming. In other words
when you want to write a function or a class type
independent, go for templates.
template<class T>
void fun(T x, T y); // Is a Template function
template<typename T>
class abc{
T m;
}; // Is a Class Template
template<class T>
class abc{
T m;
}; // Is a Class Template
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What are properties in oop?
Is html an oop?
Why do we use class in oops?
Why is polymorphism used?
What are benefits of oop?
What are the advantages of polymorphism?
Are polymorphisms mutations?
is there any choice in opting subjects like 4 out of 7
2. Give the different notations for the class.\
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
Can bst contain duplicates?
What are different oops concepts?
What is polymorphism what are the different types of polymorphism?
How is class defined?
What is abstraction example?