1.

Using new is type safe as _______________________(a) It require to be specified with type of data(b) It doesn’t require to be specified with type of data(c) It requires the name of data(d) It allocated memory for the dataThe question was posed to me during an interview.My doubt is from Overloading Member Functions in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Correct answer is (b) It doesn’t require to be specified with type of data

To explain: The NEW is type safe because we don’t have to specify the type of data that have to be allocated with memory. We can directly USE it with data name. Name of the data doesn’t matter though for type of memory ALLOCATION though.



Discussion

No Comment Found

Related InterviewSolutions