![]() |
Java Sorting Students in Decreasing Order by Score
I am trying to get this program to sort the students in decreasing order by their score. I keep getting an error message when I try to use SelectionSort. This is the error I receive.
C:\Users\Jen>javac Sort.java Sort.java:36: selectionSort(int[]) in Sort cannot be applied to (int) int sortOutput = selectionSort(scores[i]); ^ 1 error Here is the code I am using. Any help would be greatly appreciated. Code:
import java.util.*; |
Re: Java Sorting Students in Decreasing Order by Score
why are you making the selection sort?
the arrays of java contains the sort method |
Re: Java Sorting Students in Decreasing Order by Score
the main thing i would say is you initialized 2 arrays in main but you are only passing one to selection sort. you need to pass names[] and scores[] to selection sort for it to work properly. also ur error comes from the fact that u are trying to stuff an array into a primitive type variable. i would delete that entirely.
lemme know if this helps :) |
| All times are GMT +5.5. The time now is 16:49. |