Terminating a Java Program

后端 未结 7 2027
感动是毒
感动是毒 2020-11-27 12:03

I found out ways to terminate (shut-down or stop) my Java programs. I found two solutions for it.

  1. using return;
    When I want to quit or

7条回答
  •  鱼传尺愫
    2020-11-27 12:04

    1. System.exit() is a method that causes JVM to exit.
    2. return just returns the control to calling function.
    3. return 8 will return control and value 8 to calling method.

提交回复
热议问题