interface Comparable
and the compareTo() method.
interface java.lang.Comparable
to the first line of your class HawaiianTheme. For example: class HawaiianTheme implements java.lang.Comparable{
Sorting.display = false;
Sorting.selectionSort(arrayOfHawaiianThemeObjects);
You output will be similar, but not the same, as my output.
The formatting doesn't have to be exactly the same, but make sure it is neat and easy to read.
Here are details on the format() method, if you so wish to use it:
https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html
Or, in your CSV file, just make sure you leave extra spaces to evenly space the words.
Or, maybe you have your own unique way to do the formatting!
** Make sure you submit your CSV file with your assignment. **
Below is example output for using this input file as the first commandline argument: mammals2.csv
Display MarineMammalsOfHawaii array[] without initializing elements: index element 0 null 1 null 2 null 3 null 4 null 5 null 6 null 7 null 8 null 9 null 10 null 11 null 12 null 13 null 14 null 15 null 16 null 17 null Read from input file: mammals2.csv Display MarineMammalsOfHawaii array[] after initializing elements: index name population length (meters) Genus species 0 Hawaiian monk seal 1100 2.40 Monachus schauinslandi 1 humpback whale 10000 16.00 Megaptera novaeangliae 2 spinner dolphin 3351 2.35 Stenella longirostris 3 common bottlenose dolphin 235 3.50 Tursiops truncatus 4 Risso's dolphin 85000 4.00 Grampus griseus 5 rough-toothed dolphin 150000 2.83 Steno bredanensis 6 striped dolphin 2000000 2.60 Stenella coeruleoalba 7 pygmy killer whale 817 20.50 Feresa attenuata 8 false killer whale 150 2.80 Pseudorca crassidens 9 melon-headed whale 2950 3.00 Peponocephala electra 10 short-finned pilot whale 8850 3.70 Globicephala macrorhynchus 11 sperm whale 7082 17.30 Physeter macrocephalus 12 dwarf sperm whale 19000 3.00 Kogia sima 13 pygmy sperm whale 50 3.50 Kogia breviceps 14 orca 50 10.70 Orcinus orca 15 Blainville's beaked whale 2200 5.00 Mesoplodon densirostris 16 Cuvier's beaked Whale 13000 8.30 Ziphius cavirostris 17 pantropical spotted dolphin 3000000 2.50 Stenella attenuata index name population length (feet) Genus species 0 Blainville's beaked whale 2200 5.00 Mesoplodon densirostris 1 common bottlenose dolphin 235 3.50 Tursiops truncatus 2 Cuvier's beaked Whale 13000 8.30 Ziphius cavirostris 3 dwarf sperm whale 19000 3.00 Kogia sima 4 false killer whale 150 2.80 Pseudorca crassidens 5 Hawaiian monk seal 1100 2.40 Monachus schauinslandi 6 humpback whale 10000 16.00 Megaptera novaeangliae 7 melon-headed whale 2950 3.00 Peponocephala electra 8 orca 50 10.70 Orcinus orca 9 pantropical spotted dolphin 3000000 2.50 Stenella attenuata 10 pygmy killer whale 817 20.50 Feresa attenuata 11 pygmy sperm whale 50 3.50 Kogia breviceps 12 Risso's dolphin 85000 4.00 Grampus griseus 13 rough-toothed dolphin 150000 2.83 Steno bredanensis 14 short-finned pilot whale 8850 3.70 Globicephala macrorhynchus 15 sperm whale 7082 17.30 Physeter macrocephalus 16 spinner dolphin 3351 2.35 Stenella longirostris 17 striped dolphin 2000000 2.60 Stenella coeruleoalba