I need to find out the last digit of the number ( int ) in JAVA .

For example, we have a number ( int ):

 int count = 12345; int lastСharacter; 

I need the lastCharacter contain the last digit of the count . That is 5.

    1 answer 1

    The last digit of the number is equal to the remainder of the division by 10, lastCharacter = count% 10