/* Punters Lounge JAVA programming course * * Lesson5.java * * Author : Erik Datapunter * Date : 8/may/2004 * * Asking the user for input. * */ // first add this line at the very beginning of the program to include the input/output objects. import java.io.*; public class Lesson5 { // add the words : throws IOException , part of the errorhandling system public static void main(String[ ] arguments ) throws IOException { // create a buffer to read the keyboard // the object BufferedReader will be covered in full in Lesson 7 BufferedReader Readkeys = new BufferedReader ( new InputStreamReader (System.in)); String Myname; // ask a question and read from the keyboard System.out.println("What is your name ?"); Myname = Readkeys.readLine(); System.out.println("Welcome to Java, "+Myname+" , hope you enjoy it."); } }