System.setProperty and System.getProperty

后端 未结 4 1691
太阳男子
太阳男子 2020-12-23 21:09

I didn\'t understand when I used System.setProperty to define a parameter, where the data is stored?

If say that I used System.setProperty

4条回答
  •  生来不讨喜
    2020-12-23 21:36

    In the first Scenario, the moment A.java run, the JVM will stop and it will release all the values. And when the B.java run, the JVM will start fresh. So, the value will not persist across.

    In the second scenario, the JVM will not stop between the executions. So, the property value will persist from the second program.

提交回复
热议问题