Commit 7e7862d752cd6dc2e81322793771e02c2cdd9693

Authored by Christopher Yin
1 parent 13b228831c
Exists in master

Hello uses Greeter

Showing 1 changed file with 2 additions and 2 deletions Inline Diff

lib/Hello.java View file @ 7e7862d
public class Hello 1 1 public class Hello
{ 2 2 {
public static void main( String argv[]) 3 3 public static void main( String argv[])
{ 4 4 {
// Default is "World" 5 5 // Default is "World"
// Author: Chris (c8yan@ucsd.edu) 6 6 // Author: Chris (c8yan@ucsd.edu)
String name = "World"; 7 7 String name = "World";
if (argv.length != 0) 8 8 if (argv.length != 0)
{ 9 9 {
name = argv[0]; 10 10 name = argv[0];
} 11 11 }
12 12 Greeter greeter = new Greeter(name);
System.out.println("Hello, " + name + "!"); 13 13 System.out.println(greeter.greet());
} 14 14 }
} 15 15 }
16 16