5 Getting Input from Keyboard
5 Getting Input from Keyboard
5 Getting Input from Keyboard
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Steps to get <strong>Input</strong>3. Declare a temporary String variable to get the input, andinvoke the readLine() method to get input <strong>from</strong> thekeyboard. You have to type it inside a try-catch block.try{String temp = dataIn.readLine();}catch( IOException e ){System.out.println(“Error in getting input”);}Introduction to Programming 1 6