This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Changing array I think and the print statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Changing array I think and the print statement" Watch "Changing array I think and the print statement" New topic
Author

Changing array I think and the print statement

mike statham
Greenhorn

Joined: Feb 24, 2012
Posts: 16
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

Joined: Mar 17, 2011
Posts: 7689
    
  19

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


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38449
    
  23
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().
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Changing array I think and the print statement