Specifications
Sun Services
Java™ Programming Language
Module 1, slide 17 of 23
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
A Simple Java Application
The TestGreeting.java Application
1//
2 // Sample "Hello World" application
3//
4 public class TestGreeting{
5 public static void main (String[] args) {
6 Greeting hello = new Greeting();
7 hello.greet();
8 }
9}
The Greeting.java Class
1 public class Greeting {
2 public void greet() {
3 System.out.println(“hi”);
4 }
5}










