static int toDeci ( String str , int base ) {
  int len = str . length ( ) ;
  int power = 1 ;
  int num = 0 ;
  int i ;
  for ( i = len - 1 ;
  i >= 0 ;
  i -- ) {
    if ( val ( str . charAt ( i ) ) >= base ) {
      System . out . println ( "Invalid Number" ) ;
      return - 1 ;
    }
    num += val ( str . charAt ( i ) ) * power ;
    power = power * base ;
  }
  return num ;
}

static int toDeci ( String str , int base ) { int len = str . length ( ) ; int power = 1 ; int num = 0 ; int i ; for ( i = len - 1 ; i >= 0 ; i -- ) { if ( val ( str . charAt ( i ) ) >= base ) { System . out . println ( " Invalid ▁ Number " ) ; return - 1 ; } num += val ( str . charAt ( i ) ) * power ; power = power * base ; } return num ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (for_statement init: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement (unary_expression operand: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))) (return_statement (identifier))))