static int reversDigits ( int num ) {
  boolean negativeFlag = false ;
  if ( num < 0 ) {
    negativeFlag = true ;
    num = - num ;
  }
  int prev_rev_num = 0 , rev_num = 0 ;
  while ( num != 0 ) {
    int curr_digit = num % 10 ;
    rev_num = ( rev_num * 10 ) + curr_digit ;
    if ( ( rev_num - curr_digit ) / 10 != prev_rev_num ) {
      System . out . println ( "WARNING OVERFLOWED!!!" ) ;
      return 0 ;
    }
    prev_rev_num = rev_num ;
    num = num / 10 ;
  }
  return ( negativeFlag == true ) ? - rev_num : rev_num ;
}

static int reversDigits ( int num ) { boolean negativeFlag = false ; if ( num < 0 ) { negativeFlag = true ; num = - num ; } int prev_rev_num = 0 , rev_num = 0 ; while ( num != 0 ) { int curr_digit = num % 10 ; rev_num = ( rev_num * 10 ) + curr_digit ; if ( ( rev_num - curr_digit ) / 10 != prev_rev_num ) { System . out . println ( " WARNING ▁ OVERFLOWED ! ! ! " ) ; return 0 ; } prev_rev_num = rev_num ; num = num / 10 ; } return ( negativeFlag == true ) ? - rev_num : rev_num ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true))) (expression_statement (assignment_expression left: (identifier) right: (unary_expression operand: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (return_statement (ternary_expression condition: (parenthesized_expression (binary_expression left: (identifier) right: (true))) consequence: (unary_expression operand: (identifier)) alternative: (identifier)))))