Without using length and size function how could you get the 2nd last variable in an array of integers?
Anonymous
int[] arr = new int[]{1,2,4,1,4,6,2}; int count = 0; for (int i : arr) { count++; } System.out.println(arr[count-2]);
Check out your Company Bowl for anonymous work chats.