• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading in text files containing strings and ints  RSS feed

 
joel woods
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there everyone i'm fairly new with all this so please bare with me but i'm having some problems creating a method that will read a text file and return a list of the strings and int's in the order it read them using a scanner. ive already tried making a method that will randomly select strings only out of a text file i just cant seem to wrap my head around this one. I'm also not sure if im going about this in the right way :/
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, joel.

First pancake it seems, usual one

Your code has some problems.

You use methods and variable names you did not define, hence supposed to cause you some complication errors.
After you fix those, there will be logical errors which prevent your program from behaving in the way you expect it.

Is it the all code or just a snippet?
 
joel woods
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry i should've mentioned this is just a snippet, i have a skills method in the same package
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. I was referring to "fFilePath" (line 13), please specify the line where you declared that?
2. Please specify line number, where you declared method "processLine" (calling at line 19)?
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Java is case sensitive. Hence there is no such data type as string, there is String.
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also you can try to go through Oracle tutorial here, there supposed to be examples how to read files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!