Created
March 9, 2011 12:38
-
-
Save tormaroe/862114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
class MyFirstProgram { | |
/** Print a hello message */ | |
public static void main(String[] args) { | |
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); | |
String name = "Instructor"; | |
System.out.print("Give your name: "); | |
try { | |
name = in.readLine(); | |
} | |
catch(Exception e) { | |
System.out.println("Caught an exception!"); | |
} | |
System.out.println("Hello " + name + "!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment