Extract subarray of elements that appear after the last occurrence of "4"
I would use this:

public int[] post4(int[] arr) {
  for(int i = arr.length-1; i &gt;= 0; --i) {
    if(arr[i] == 4) {
      return Arrays.copyOfRange(arr, i+1, arr.length);
    }
  }
  return new int[0]; // or null
}