• Post Reply Bookmark Topic Watch Topic
  • New Topic

Transfering values from a ArrayList<String[]> into a ArrayList<Case>();  RSS feed

 
Jame Sutton
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!I try to read separe number in text file...This text file contain some number like 001 or 156 ...My main goal is to put these number in an arraylist like ArrayList<Case> alf = new ArrayList<Case>();

It seem to print separate numbers by now but I wonder how can I transfet each one of theses 3 sets in my arraylist...

Someone help me please...I've red a lot of forum on google and I can't seem to find a solution.

Thank!








 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jame Sutton wrote:Hi!I try to read separe number in text file...This text file contain some number like 001 or 156 ...My main goal is to put these number in an arraylist like ArrayList<Case> alf = new ArrayList<Case>();


It would help us if you explain to us, (1) what is a Case class? (2) What has this got to do with a File? And (3) how it is related to a string array?

Henry
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your numbers are in a file, why not read them as numbers directly. Look in the Java Tutorials about “scanning”.
If you want Case objects make Case objects, don't use Strings as an intermediate step.
 
Jame Sutton
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank for your help...Checking scan method on the oracle website really helped me out...
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yoiu're welcome
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!