title: How to get the last digit of a long?
body: <p>I am trying to write Java code to obtain the last digit of a long (i.e. the rightmost digit). </p>
  
  <p>If I were trying to obtain the last element of a string, I would use the substring() method.</p>
  
  <p>What is the alternative or equivalent way when getting the last digit of a long?</p>