Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Changing array I think and the print statement  RSS feed

 
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
Posts: 10573
65
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: 53750
127
  • 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
Boost this thread!