Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input from a file ....problem with readInt()

Status
Not open for further replies.

dilse

Programmer
Jul 21, 2001
6
IN
I am using this code for file reading here i am supposed to take Strings ,ints,

FileInputStream fin=new FileInputStream(args[0]); //reads file
BufferedReader br = new BufferedReader(new InputStreamReader(fin));


I am using br.readLine() for reading Strings ...It works fine

But while reading the ints i am using br.readInt() ...where i am getting an error.


Plese help me to sort it out

 
Hi Dilse,

There are no such method readInt() in the JavaAPI for the class BufferedReader. That is why it is giving you a compilation error. What you can do is to read in the int as a String and convert it to a int value instead.

Here is the url for the Java API if you need it:-

Regards,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top