Advertisement
MuchFractured

[CODE] Getting User Input

Jan 2nd, 2014
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. // Code for the fourth episode in the series: http://youtu.be/gXkOyjFgils
  2.  
  3. import java.util.Scanner;
  4.  
  5.  
  6. public class UserInput {
  7.    
  8.     public static void main(String[]args) {
  9.        
  10.         Scanner sc = new Scanner(System.in);
  11.        
  12.         System.out.println("What is your name?");
  13.        
  14.         String name = sc.next();
  15.        
  16.         System.out.println("Hello, " + name + ". Welcome to this world!");
  17.        
  18.         sc.close();
  19.        
  20.     }
  21.    
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement