Charles D. Ward wrote:Kudos for the Final Fantasy X references btw.
Robert D. Smith wrote:
I will add another link or two that you might add to your reading list. The first is to the Code Conventions for Java Programming from Sun. And the second is JavaRanch Style Guide.
Anayonkar Shivalkar wrote:Hi Neil,
Welcome to CodeRanch!
Good to see code tags in your first post itself.
If your assignment is not specific to writing your own sorting logic, then you may take advantage of ready-made APIs provided by Java (hint: how about Collections?)
I hope this helps.
Paul Clapham wrote:
As you see your version compiles and runs perfectly well, so technically there's nothing wrong with it, but it does help to write code which other Java programmers will find a little bit easier to understand.
Michael Romero wrote:Instead of storing each character individually in their own variable I would use an array.
Then I would sort the character array from highest to lowest, there's quite a few algorithms available for sorting.
The main problem with your approach is that it will not scale very well.
What would you do if you had 20 characters? Would you write 20 else if clauses?
Bear Bibeault wrote:
Variable names should start with lowercase. Alos avoid using variable names that are the same as other items; in this case the enum values.