57.9k views
5 votes
Which of the following statements Terminates the program andstops all threads?

a. Return(0);

b. Exit;

c. System.exit(1);

d. System.exit(0);

1 Answer

6 votes

Answer:

(c) system.exist(1);

Step-by-step explanation:

system.exist(1); is used for the termination of the program here both option c and d should be correct but in option d there is exit(0) and zero indicates return means program will return but besides zero if there is any non zero number then program will not return and in option c there is a non zero number which means program will not return so option c system.exist(1); will be the correct option for the termination of program

User Manishika
by
8.6k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.