📌  相关文章
📜  获取数组java代码示例的最后一个元素

📅  最后修改于: 2022-03-11 14:52:13.004000             🧑  作者: Mango

代码示例6
int[] someArray = {1,2,3,4,5};
int first = someArray[0];
int last = someArray[someArray.length - 1];
System.out.println("First: " + first + "\n" + "Last: " + last);