1.

Which function should be used to exit from the program that is provided by System class?(a) exit(int);(b) gc();(c) terminate();(d) halt();I have been asked this question in unit test.I want to ask this question from Inbuilt Classes topic in section Inbuilt Classes of Object Oriented Programming

Answer»

The correct answer is (a) exit(INT);

To explain: The exit function should be used to terminate the program. The function is PASSED with an ARGUMENT. The argument INDICATED the type of error occurred.



Discussion

No Comment Found

Related InterviewSolutions