![]() |
The Java Developers Almanac 1.4 |
|
e34. Reading Text from Standard Input try {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String str = "";
while (str != null) {
System.out.print("> prompt ");
str = in.readLine();
process(str);
}
} catch (IOException e) {
}
e36. Reading a File into a Byte Array e37. Writing to a File e38. Appending to a File e39. Using a Random Access File
© 2002 Addison-Wesley. |