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

by java  by java Task 2 Last Digit: Write a method called lastDigit

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!