Java - Hello You Program


Home

Author: Kevin Albrecht
Date: October 19, 1997
Info: JavaSoft Website
import java.io.*;

class HelloYou {
  public static void main (String args[]) {
    byte name[] = new byte[100];
    int nr_read = 0;
    System.out.println("What is your name?");
    try {
      nr_read = System.in.read(name);
      System.out.print("Hello ");
      System.out.write(name,0,nr_read);
    }
    catch (IOException e) {
      System.err.println ("Error.");
    }
  }
}

Home