int [] numbers = {1, 2, 3, 4, 5}; firstElement = numbers[0]; lastElement = numbers[numbers.length-1];