Question: what is the difference between return and system exit 0 in java?
Answer: return statement is used inside a method to come out of it. System. exit(0) is used in any method to come out of program.