The else statement in Java

// This is the Hello program in Java

class Hello {

    public static void main (String args[]) {
    
      if (args.length > 0) {
        System.out.println("Hello " + args[0]);
      }
      else {
        System.out.println("Hello whoever you are.");
      }
  }

}

Previous | Next | Top | Cafe au Lait

Copyright 1997, 1999 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified September 24, 1999