next up previous
Next: Interleaving reading and writing Up: Unit 09 Previous: Reading from an input

A program that (sometimes) determines the plural of a word

import java.io.*;

public class Plural {
  public static void main(String[] args) throws IOException {
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader keyboard = new BufferedReader(isr);
    System.out.println("Insert a word:");
    String line = keyboard.readLine();
    System.out.print(line);
    System.out.println("s");
  }
}


next up previous
Next: Interleaving reading and writing Up: Unit 09 Previous: Reading from an input