Saturday, June 27, 2009

How to Read Text from Standard Input


try {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String str = "";
while (str != null) {
str = in.readLine();
System.out.println(str);
}
} catch (IOException e) {
}

1 comments:

bujju on August 1, 2010 at 6:35 AM said...

Thanks for sharing.
medical devices and gadgets

 

Sample Java Codes Copyright © 2008 Green Scrapbook Diary Designed by SimplyWP | Made free by Scrapbooking Software | Bloggerized by Ipiet Notez