嗨,我试图返回两个数组,1作为字符串,另一个作为浮点数; 返回我在网上搜索它是令人困惑的,我是新来的oops
public String[][] loadcost(String[][] arr2, int tcount) {
int f1 = 1;
int f2 = 0;
int[] costarr = null ;
while (f2 < tcount){
arr2[f1][f2] = cost.nextLine();
costarr[f2] = Integer.parseInt (arr2[f1][f2]);
f2 = f2 + 1;
}
Arrays.sort(costarr);
return arr2 , costarr ;
Run Code Online (Sandbox Code Playgroud)
我最初的要求是对二维数组进行排序,它使用我在网上得到的代码
BBB 444 DDD 098 FF 19.01
想用第二列排序
java ×1