Java: sort a String array, whose strings represent int

后端 未结 8 1162
北恋
北恋 2020-12-16 14:09

I have String[] array like

{\"3\",\"2\",\"4\",\"10\",\"11\",\"6\",\"5\",\"8\",\"9\",\"7\"}

I want to sort it in numerical ord

8条回答
  •  [愿得一人]
    2020-12-16 14:54

    public class test1 {

    public static void main(String[] args) 
    {
        String[] str = {"3","2","4","10","11","6","5","8","9","7"};
        int[] a = new int[str.length];
        for(int i=0;i

    }

提交回复
热议问题