2009年3月9日 星期一

Lab Keyboard Input

Rewrite Display 2.6 using BufferedReader.You need to import the following packages in the first place.import java.io.BufferedReader;import java.io.InputStreamReader;import java.io.IOException;ChangeScanner keyboard= new Scanner(System.in);intoBufferedReader keyboard= new BufferedReader(new InputStreamReader(System.in));String inputString = keyboard.readLine();Note the Main method needs IOException handling as follows:public static void main (String[] args) throws IOException


沒有留言:

張貼留言