The problem is that you also used double to index arrays. So try this:
public static void selectionSort (double...arr)
{
int i = 0, j = 0, smallest = 0;
double temp = 0.0;
for (i = 0; i < arr.length - 1; i++)
{
smallest = i;
for (j = 1; j < arr.length - 1; j++)
{
if (arr[j] < arr[smallest])
smallest = j;
}
temp = arr[smallest];
arr[smallest] = arr[i];
arr[i] = temp;
}
}
As you can see, you still have the doubles parameter, and temp-value and arr-array also still double, but the indexes that are used for the array are ints.
int. , , - ints :
String[] sArray = {
"word1",
"word2",
"word3"
}
int index = 1;
String result = sArray[index];