1.

The method called by clients of a class to explicitly release any resources like network, connection, open files etc. When the object is no longer required?(a) Finalize()(b) End()(c) Dispose()(d) Close()This question was posed to me in semester exam.Enquiry is from Destructors in Class in division Classes of C#

Answer»

Correct OPTION is (c) Dispose()

Easy explanation - Dispose() is only method called by clients of a class to EXPLICITLY release any resource like network connection, open files ETC. When object is no LONGER required. Hence, Dispose() PROVIDES programmer with such programming control.



Discussion

No Comment Found

Related InterviewSolutions