首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 系统运维 >

sun.misc.VM.getSavedProperty跟System.getProperty的区别是什么

2014-01-03 
sun.misc.VM.getSavedProperty和System.getProperty的区别是什么java运行的设置:-Djava.lang.Integer.Inte

sun.misc.VM.getSavedProperty和System.getProperty的区别是什么
java运行的设置:
-Djava.lang.Integer.IntegerCache.high=250
-Dhigh=250

public static void main(String[] args) {String a = sun.misc.VM.getSavedProperty("java.lang.Integer.IntegerCache.high");String b = sun.misc.VM.getSavedProperty("high");String c = System.getProperty("java.lang.Integer.IntegerCache.high");String d = System.getProperty("high");System.err.println(a);System.err.println(b);System.err.println(c);System.err.println(d);}


结果:
250
250
null
250

为什么对于java.lang.Integer.IntegerCache.high这个设置的参数值用System.getProperty获取不到,但是用sun.misc.VM.getSavedProperty是可以获取到的?

热点排行