发布网友 发布时间:2022-04-24 03:15
共1个回答
热心网友 时间:2023-10-24 06:34
try{
final int EOF = -1;
HashTable h = new HashTable();
Reader r = new FileReader(new File(args[0]));
int c = r.read();
while (c != EOF){
System.out.print((char)c); // 未作缓冲
Character key = new Character((char)c);
Object count = h.get(key);
if (count == null){count = new Integer(1);}
else {count = new Integer(((Integer)count).intValue + 1);}
h.put(key, count);
c = r.read();
}
}catch{...}
热心网友 时间:2023-10-24 06:33
try{
final int EOF = -1;
HashTable h = new HashTable();
Reader r = new FileReader(new File(args[0]));
int c = r.read();
while (c != EOF){
System.out.print((char)c); // 未作缓冲
Character key = new Character((char)c);
Object count = h.get(key);
if (count == null){count = new Integer(1);}
else {count = new Integer(((Integer)count).intValue + 1);}
h.put(key, count);
c = r.read();
}
}catch{...}
热心网友 时间:2023-10-24 06:33
try{
final int EOF = -1;
HashTable h = new HashTable();
Reader r = new FileReader(new File(args[0]));
int c = r.read();
while (c != EOF){
System.out.print((char)c); // 未作缓冲
Character key = new Character((char)c);
Object count = h.get(key);
if (count == null){count = new Integer(1);}
else {count = new Integer(((Integer)count).intValue + 1);}
h.put(key, count);
c = r.read();
}
}catch{...}