/** * @author lautturi.com * Java example: */ import java.util.*; public class Lautturi { public static void main(String[] args) { int [] numbers = {1, 2, 3, 4, 5}; int firstElement = numbers[0]; int lastElement = numbers[numbers.length-1]; // stores the last element of arr } }