Deprecated readLine method

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

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

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

my confusion was with this part:
new InputStreamReader(fstream)
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.