public static int firstDigit ( int n ) {
  while ( n >= 10 ) n /= 10 ;
  return n ;
}

public static int firstDigit ( int n ) { while ( n >= 10 ) n /= 10 ; return n ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) (return_statement (identifier))))