they are stored in the file just like that with no commas and I need to read that file and store each number into a variable so I can compare each number seperately to another number.

I tried reading the post earlier from someone else but I don't think that this is the same kind of problem.

I could store a seperate file for each number and compare that way, but I am trying to be more efficient and save space. Could someone please tell me how to do this.

Thank you.

06-09-2008, 06:24 AM

sukatoa

Do it with Scanner class....

have some experiments on nextInt() method.....

06-09-2008, 07:21 AM

kewlgeye

Ok, I did a little research on this and I found this code. I modified it a little to work for me, but I know it is not correct, I think that I am closer though, could you please help me understand what I am doing wrong, or need to do next?? thank you

And about that implementation, i think you should initialize those variables on member's field....(global variable)

So that, you can just implement directly setters/getters method...

06-09-2008, 04:44 PM

kewlgeye

how-store-5-numbers-file-into-5-seperate-variables

Thank you for your help sukatoa

I used the scanner class and nextInt() method like you said, and it almost looked similar to the code I posted earlier but I didn't use the has next, and put nextInt() instead of just next when adding to the variables of the type int.

If I had my code in front, I would have posted it for all to benefit if they are as novice as myself.