Question: by java Task 2 Last Digit: Write a method called lastDigit that returns the last digit of an integer. For example, the call lastDigit(3572) should
Task 2 Last Digit: Write a method called lastDigit that returns the last digit of an integer. For example, the call lastDigit(3572) should return 2. It needs to work for negative numbers as well. For example, the call lastDigit!-5489) should return 9. Complete this by having your main method call your method with the above arguments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
