title: How to implement negative indexes in java?
body: <p>In Python, you are allowed to use negative array indices to count starting from the right side of an array. For example, <code>array[-1]</code> is last element and <code>array[-2]</code> is the second last element in the array. How would you implement this in Java?</p>