- package com.itheima;
- import java.util.Map.Entry;
- import java.util.Properties;
- public class SystemDemo {
- public static void main(String[] args) {
- Properties prop = System.getProperties();
- for(Entry<Object, Object> entry :prop.entrySet()){
- System.out.println(entry);
- System.out.println(entry.toString());
-
- }
- }
- }
复制代码
输出为什么是java.runtime.name=Java(TM) SE Runtime Environment这种格式的字符串呢?还有toString()方法也是这样,难道它本事就是字符串?他应该是一种map集合啊,查看toString()方法也没看到有重写!不解·····
|