java.util.Properties
This commit is contained in:
parent
4d9579e13d
commit
e4d146365b
@ -1,4 +1,20 @@
|
||||
package chapter6;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Properties;
|
||||
|
||||
public class Example21 {
|
||||
public static void main(String[] args) {
|
||||
Properties p = new Properties();
|
||||
p.setProperty("Backgroudnd", "red");
|
||||
p.setProperty("Font-size", "14px");
|
||||
p.setProperty("Language", "Chinese");
|
||||
|
||||
Enumeration names = p.propertyNames();
|
||||
while (names.hasMoreElements()) {
|
||||
String key = (String) names.nextElement();
|
||||
String value = p.getProperty(key);
|
||||
System.out.println(key + "=" + value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user