InterviewSolution
Saved Bookmarks
| 1. |
Can default arguments be used with the template class?(a) Yes, in some special cases(b) Yes, always(c) No, it must satisfy some specific conditions first(d) No, it can’t be doneI have been asked this question by my college professor while I was bunking the class.The question is from Template Class in chapter Classes of Object Oriented Programming |
|
Answer» RIGHT answer is (b) YES, always To explain: The template CLASS can use DEFAULT arguments. This is used to specify the data type to be CONSIDERED if it is not specified while passing to the generic class. The default type will be used. |
|