how to read the input in java
import
java.io.*;
class wrd
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String input()
{
String txt=null;
System.out.print("Enter a word:");
try{
txt=br.readLine();
}
catch(IOException e){
System.out.println("Error at "+e);
}
return txt;
}
public static void main(String arg[])
{
wrd obj=new wrd();
System.out.println("Entered word is: "+obj.input());
}
}
Wednesday, November 21, 2012
how to read the input in java
6:15 PM
No comments
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment