How in Java do you return the first digit of an integer.?
i.e.
345
Returns an int of 3.
int firstNumber(int x){ int firstN = x; while(firstN > 9){ firstN = (firstN - (firstN%10))/10; } return firstN; }