The way java does this is kind of complicated (actually it is similar to c++ way with std io), you open a file with an FileInputStream, then wrap the FileInputStream with InputStreamReader to become a Reader, then wrap the InputStreamReader to become a BufferedReader, then use readLine(), finally parse out. Kao.
in Java 5.0 (was called 1.5.0 before) you can use scanf/printf same as in c
【在 c**g 的大作中提到】 : The way java does this is kind of complicated (actually : it is similar to c++ way with std io), you open a file : with an FileInputStream, then wrap the FileInputStream with : InputStreamReader to become a Reader, then wrap the : InputStreamReader to become a BufferedReader, then : use readLine(), finally parse out. Kao.
w*r
5 楼
ft.... you guys are really die-hard C junkie!!!
【在 c******s 的大作中提到】 : in Java 5.0 (was called 1.5.0 before) you can use scanf/printf same as in c
c*y
6 楼
3x
【在 c**g 的大作中提到】 : The way java does this is kind of complicated (actually : it is similar to c++ way with std io), you open a file : with an FileInputStream, then wrap the FileInputStream with : InputStreamReader to become a Reader, then wrap the : InputStreamReader to become a BufferedReader, then : use readLine(), finally parse out. Kao.
c*g
7 楼
Actually I do appreciate the elegent (or elephant?) way of Java io to read a file after couples of year java coding. But it does look so stupid for first time user, hehe.
【在 w*r 的大作中提到】 : ft.... you guys are really die-hard C junkie!!!
w*r
8 楼
their IO interface is very elegent, clear-cut and highly flexible.
【在 c**g 的大作中提到】 : Actually I do appreciate the elegent (or elephant?) way of Java io : to read a file after couples of year java coding. But it does look : so stupid for first time user, hehe.
m*t
9 楼
FileReader would lend a little convenience here.
【在 c**g 的大作中提到】 : The way java does this is kind of complicated (actually : it is similar to c++ way with std io), you open a file : with an FileInputStream, then wrap the FileInputStream with : InputStreamReader to become a Reader, then wrap the : InputStreamReader to become a BufferedReader, then : use readLine(), finally parse out. Kao.