import java.io.*; //import BufferedReader public class ExampleIO{ //notice, I have to 'throw IOException'. This means that I will simply //exit the program if I have any IO Errors public static void main(String[] args) throws IOException{ //for now, don't worry about what this next line does! BufferedReader keyboard=new BufferedReader(new InputStreamReader(System.in)); String str1; //declare empty String int int1; double dbl1; //example of reading in a string System.out.print("Enter a string: "); str1=keyboard.readLine(); //puts a copy of the users string in str1 System.out.println("You entered: " + str1); //example of reading in an integer System.out.print("\nEnter an integer: "); str1=keyboard.readLine(); //enters the int as a string, notice I'm reusing str1 int1=Integer.parseInt(str1); //convert String to an int. for now, don't worry about how it works! System.out.println("You entered: " + int1); //example of reading in a double System.out.print("\nEnter an double: "); str1=keyboard.readLine(); //enters the int as a string, notice I'm reusing str1 dbl1=Double.parseDouble(str1); //convert String to an double. for now, don't worry about how it works! System.out.println("You entered: " + dbl1); } }