Deprecated readLine method

 The .readLine is deprecated for string, what would I use instead to still read a  line of string?

           FileInputStream fstream = new
         FileInputStream(args[0]);
         DataInputStream in = new DataInputStream(fstream);
           String line;
                  while((line =in.readLine()) != null) {
kellyputtyAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
Use BufferedReader instead

BufferedReader in = new BufferedReader(new InputStreamReader(fstream));
0
 
kellyputtyAuthor Commented:
ah that worked,

my confusion was with this part:
new InputStreamReader(fstream)
thanx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.