scg/ch11/YourNameHere

From FANG

Jump to: navigation, search

01 package scg.ch11;
02 
03 import java.util.Scanner;
04 
05 /**
06  * Greeting program. Standard output for a non-FANG console I/O program;
07  * user provides her name at a prompt.
08  */
09 public class YourNameHere {
10   /**
11    * The main program. Prompt user for her name and print a greeting
12    for her.
13    *
14    @param  args  command-line arguments; ignored by this program
15    */
16   public static void main(String[] args{
17     Scanner keyboard = new Scanner(System.in);
18     System.out.print("What is your name? ");
19     String userName = keyboard.next();
20     System.out.println("Hello, " + userName + "!");
21   }
22 }
23 
24 //Uploaded on Mon Mar 29 21:41:09 EDT 2010


Download/View scg/ch11/YourNameHere.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter

Games
Games