📅  最后修改于: 2022-03-11 14:52:33.484000             🧑  作者: Mango
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);