Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

2 Files, 1 Object  RSS feed

 
Zach Ellerbrook
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have 2 files, Competitors.txt and Marks.txt. The Competitors file contains an IDnumber(int) and a name(String). The Marks file contains an IDnumber(int) and a mark(double). The ID in each file correspond to each other, and all three variables need to be stored in 1 Competitor object.

How do I read the Competitors.txt file and Marks.txt file into 1 Competitor object with ID, name, and mark as instance variables?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like a homework assignment. We love to help people, but we also ask that you do your own work. Are you comfortable working with files? Do you have any ideas as to how to link the two files? What have you done so far?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!