1.

How many generic types can be given inside a single template class?(a) Only 1(b) Only 3(c) Only 7(d) As many as requiredThe question was posed to me during an online exam.My enquiry is from Template Class topic in section Classes of Object Oriented Programming

Answer»

Right OPTION is (d) As MANY as required

Best explanation: There is no restriction on the number of types to be USED for making the class GENERIC. There can be any number of generic types with a single class. Hence giving flexibility to code with all the data types.



Discussion

No Comment Found

Related InterviewSolutions