How to delete the last element from an array?

前端 未结 3 1650
情书的邮戳
情书的邮戳 2021-01-04 04:15

Now I\'m working with the recursive backtracking,my assignment is to find the longest path in the maze,the mass is presented as the field covered with the coordinates,and th

3条回答
  •  盖世英雄少女心
    2021-01-04 05:06

    Since in Java, arrays are non-resizable, you will have to copy everything into a new, shorter array.

    Arrays.copyOf(original, original.length-1)
    

提交回复
热议问题