Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing array I think and the print statement

 
mike statham
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to change from Syste.out.printf() too println() on main program.

I also want to have not to rely on just five records in afile, have the ooption of having five or a 1000 without having to set the field vaule, is these possible?

 
Winston Gutkowski
Bartender
Pie
Posts: 10236
58
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mike statham wrote:I want to change from Syste.out.printf() too println() on main program.

So do it. I don't understand the question.

I also want to have not to rely on just five records in afile, have the ooption of having five or a 1000 without having to set the field vaule, is these possible?

Yes. Have a look at ArrayList.

BTW, please split up that enormous line in your code. It really screws up the windowing software here.

Winston
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why haven’t you got a Student class which encapsulates name and marks? Trying to run two arrays in parallel is error-prone and not good design.
You can have as many lines as you like, but they are a lot easier to add to a List than to an array.
Keep printf(); it is more versatile than println().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic