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 dataThis question was addressed to me in a national level competition.My doubt is from Memory Allocation of Object topic in division Object of Object Oriented Programming

Answer»

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

Easiest explanation - 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