R
RC
in java.io.*;
In PrintWriter and PrintStream classes
they both have two format(...) methods.
So I can write similar like C/C++
printf, fprintf and sprintf in format like %5.1f.
But I can't find an IO class has format reader
similar to C/C++
scanf, fscanf and sscanf
I have some input data look like
" 0.1-10.2" (two spaces at the front).
They are two float numbers 0.1 and -10.2 (NOT 0.1 minus 10.2)!
The best way to read this is read them in format "%5.1f%5.1f"
If the data look like " 0.1 -10.2", then I can use StringTokenizer
Now I have to read 5 characters a time!
In PrintWriter and PrintStream classes
they both have two format(...) methods.
So I can write similar like C/C++
printf, fprintf and sprintf in format like %5.1f.
But I can't find an IO class has format reader
similar to C/C++
scanf, fscanf and sscanf
I have some input data look like
" 0.1-10.2" (two spaces at the front).
They are two float numbers 0.1 and -10.2 (NOT 0.1 minus 10.2)!
The best way to read this is read them in format "%5.1f%5.1f"
If the data look like " 0.1 -10.2", then I can use StringTokenizer
Now I have to read 5 characters a time!