public static long sod ( String num ) {
  long sum = 0 ;
  char [ ] arr = num . toCharArray ( ) ;
  for ( char i : arr ) sum += Character . getNumericValue ( i ) ;
  return sum ;
}

public static long sod ( String num ) { long sum = 0 ; char [ ] arr = num . toCharArray ( ) ; for ( char i : arr ) sum += Character . getNumericValue ( i ) ; return sum ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (return_statement (identifier))))