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;
Change
Scanner keyboard= new Scanner(System.in);
into
BufferedReader 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
導覽連結: 首頁 -> 年份: 2007 -> 月份: 10 -> 標題: Lab: Keyborad Input
2007年10月5日 星期五
Lab: Keyborad Input
ARTICLE LABELS: Java
訂閱:
張貼留言 (Atom)
0 COMMENT:
張貼留言