{
public void selectsort(int[] arr)
{
for(int x=0;x
for(int y=0;y
if(arr[y]>arr[y+1])
{
int temp = arr[y];
arr[y] = arr[y+1];
arr[y+1] = temp;
}
}
}
}
}
class Demo
{
public static void main(String[] args)
{
int[] arr = {3,4,1,8};
new ArrayTool().selectsort(arr);
System.out.println("arr[]="+arr);//这里输出的是乱码,请帮忙修改一下
}
}