001 /**
002 * This is part of HW2: Environment Setup and Java Introduction for CSE 331.
003 */
004 package hw2;
005
006 /**
007 * HelloWorld is an implementation of the token
008 * introductory "Hello World" program.
009 *
010 * HelloWorld is also the superclass for other classes in this package.
011 */
012 public class HelloWorld {
013
014 /** the greeting to display when this getGreeting() is invoked */
015 static final String greeting = "Hello World!";
016
017 /**
018 * @effects prints the string "Hello World!" to the console
019 */
020 public static void main(String[] args) {
021 HelloWorld myFirstHW = new HelloWorld();
022 System.out.println(myFirstHW.getGreeting());
023 }
024
025 /**
026 @return Returns a greeting (in English).
027 */
028 public String getGreeting() {
029 return greeting;
030 }
031
032 }