how to get last 5 values in java code example Example: getting the last value of an integer in java int lastDigit = number % 10