如果我们创建一个像这样的属性:
Properties properties = new Properties();
properties.put("[%1]", "username");
properties.put("[%2]", "password");
然后添加什么作为属性中的键。
如果我们创建一个像这样的属性:
Properties properties = new Properties();
properties.put("[%1]", "username");
properties.put("[%2]", "password");
然后添加什么作为属性中的键。
java.util.Properties从java.util.HashTable继承put 方法,因此您的密钥将是并且在您的情况下。"[%1]"
"[%2]"
public V put(K key,
V value)
properties.put(<key>, <value>);
这是你想知道的。
Properties
是 的子类Hashtable
,它表示一组持久的属性。
Properties#put
方法继承自超类HashTable
。