leonteale

your name

Feb 17th, 2012
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. class yourname {
  4.   public static void main (String[] args) throws IOException {
  5.  
  6.     // Defines the standard input stream
  7.     BufferedReader stdin = new BufferedReader
  8.       (new InputStreamReader(System.in));
  9.     String name; // Creates a varible called message for input
  10.  
  11.     System.out.print ("Enter your name: ");
  12.     System.out.flush(); // empties buffer, before you input text
  13.     name = stdin.readLine();
  14.  
  15.     System.out.println("Your name is: " + name);
  16.  
  17.   }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment