This is your first post, so you get some extra tolerance, but the code you posted did not produce the output you said it did. If you want our help you must start by being honest with us.

oh, i am sory for my mistake, i promise will post better next time :)
Ok, this is my complete code

public class JavaSort {
private double[] temp;
private int i;
public void evaluation(){
temp=new double[4];
for(i=0;i<temp.length;i++)
temp[i]=i*Math.random();
sort(temp);
for(i=0;i<temp.length;i++)
System.out.println("Result"+i+ "=>"+temp[i]);
}
public void sort(double[] temp) {
for (i = 0; i < temp.length; i++) {
int min = i;
for (int j = i; j < temp.length; j++) {
if (temp[j] < temp[min])
min = j;
}
double tmp;
tmp = temp[i];
temp[i] = temp[min];
temp[min] = tmp;
}
}
public static void main(String[]args){
JavaSort k= new JavaSort();
k.evaluation();
}
}

in this code, i tried to sort temp[i] by bubble sort, but i don't know how to sort temp[i] with add original index from first loop, as my question above. please help me to solve it.

It's a bit messy, but what you have to do is create a second array containing all the indexes (originally 0, 1, 2, etc).
Then in your bubble sort, every time you swap two values, you also swap the corresponding entries in the array of indexes. So you keep the indexes array in step with the values.

You're just sorting numnbers, so a Comparator isn't needed. You need any sort algorithm that you code yourself because you need to keep the index array in synch.

So I am having trouble knowing what to return in the bottom method any help would be appreciated .
Here are the specifications for completing the StringArray class: