Ulf Dittmer wrote:The selectionSort method replaces the existing array "A" with a new (and empty) array in line 77, and then proceeds to access the non-existing elements of that array.
Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer wrote:Does the readArray method properly initialize all array elements?
andrew cassato wrote:
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:
andrew cassato wrote:
If you would have listened to me, you wouldn't need that extra object "f". You could just have written Also, if you want to sort, you should consider using Arrays.sort unless writing the sorting is homework.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:Sure. The only problem the Fraction class itself has is the Comparator / Comparable issue. And you can tell you professor that implementing Comparator<Fraction> instead of Comparable<Fraction> is bad design. Tell him I said so
SortFractions is where the real problem lies, and that's where you need to work on.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
A tiny monkey bit me and I got tiny ads:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|