dogcai.txt:
#Telephone book
Illinois=dogcai
caiyuhong=Olympia
huyhuyuh = aurkrir
grfrgtr =frgt sswimport java.util.*;
import java.io.*;class Property {
public static void main(String args[]) {
try {
Properties cap = new Properties();
Set states;
String str;
FileInputStream out = new FileInputStream("dogcai.txt");
try {
if(out !=null) {
cap.load(out);
out.close();
}
}catch(IOException e) {
System.out.println("Can't open the file!!");
}
states = cap.keySet();
Iterator it = states.iterator();
while(it.hasNext()) {
str = (String)it.next();
System.out.println(str+cap.getProperty(str));
}
out.close();
}catch(IOException e) {
}
}
}
这个是最基本的运用,你只需要在它的基础上,修改一下,就可以了。
#Telephone book
Illinois=dogcai
caiyuhong=Olympia
huyhuyuh = aurkrir
grfrgtr =frgt sswimport java.util.*;
import java.io.*;class Property {
public static void main(String args[]) {
try {
Properties cap = new Properties();
Set states;
String str;
FileInputStream out = new FileInputStream("dogcai.txt");
try {
if(out !=null) {
cap.load(out);
out.close();
}
}catch(IOException e) {
System.out.println("Can't open the file!!");
}
states = cap.keySet();
Iterator it = states.iterator();
while(it.hasNext()) {
str = (String)it.next();
System.out.println(str+cap.getProperty(str));
}
out.close();
}catch(IOException e) {
}
}
}
这个是最基本的运用,你只需要在它的基础上,修改一下,就可以了。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货