import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
// "java.io.*;" can be use also
public class HowBuffered {
//be sure to use proper filename
public static void main(String[] args) throws IOException {
//most methods of IO must have throws IOException
BufferedReader realmyn=new BufferedReader(new InputStreamReader(System.in));
//this must be the statement
String name; // declare name as string
System.out.println("anu pangalan mo?");
name=realmyn.readLine();
// the system will read the user's name, any.
System.out.println("Kumusta ka "+name+"?");
}
}
OUTPUT:
anu pangalan mo?
user's input kahit anu name:)
Kumusta ka user's input kahit anu name:)?
More examples by request
More lessons to come.
SHARE and LEARN!
No comments:
Post a Comment