public static void readFile ( ) throws IOException {
  FileWriter fstream = new FileWriter ( "out.txt" ) ;
  BufferedWriter out = new BufferedWriter ( fstream ) ;
  FileReader input = new FileReader ( "in.txt" ) ;
  BufferedReader bufRead = new BufferedReader ( input ) ;
  String line = bufRead . readLine ( ) ;
  String current = getResult ( line ) ;
  int i = 1 ;
  out . write ( "Case #" + i + ": " + current ) ;
  line = bufRead . readLine ( ) ;
  while ( line != null ) {
    i ++ ;
    System . out . println ( "Case #" + i + ": " + getResult ( line ) ) ;
    out . write ( '\n' + "Case #" + i + ": " + getResult ( line ) ) ;
    line = bufRead . readLine ( ) ;
  }
  bufRead . close ( ) ;
  out . close ( ) ;
}

public static void readFile ( ) throws IOException { FileWriter fstream = new FileWriter ( " out . txt " ) ; BufferedWriter out = new BufferedWriter ( fstream ) ; FileReader input = new FileReader ( " in . txt " ) ; BufferedReader bufRead = new BufferedReader ( input ) ; String line = bufRead . readLine ( ) ; String current = getResult ( line ) ; int i = 1 ; out . write ( " Case ▁ # " + i + " : ▁ " + current ) ; line = bufRead . readLine ( ) ; while ( line != null ) { i ++ ; System . out . println ( " Case ▁ # " + i + " : ▁ " + getResult ( line ) ) ; out . write ( ' \n ' + " Case ▁ # " + i + " : ▁ " + getResult ( line ) ) ; line = bufRead . readLine ( ) ; } bufRead . close ( ) ; out . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (character_literal) right: (string_literal)) right: (identifier)) right: (string_literal)) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))