The Anatomy of a Java Application |
This page provides a comparison between the DateApp application and The "Hello World" Application If you are not familiar with the "Hello World" application or are not interested in how these two programs differ, just skip this page and go on to the next.The bold lines in the two program listings below highlight where the programs differ from one another. Specifically,
DateApp
imports the Date class- the applications have different names:
DateApp
vs.HelloWorldApp
DateApp
creates a Date object- the applications print different output
The DateApp Application
import java.util.Date; class DateApp { public static void main (String args[]) { Date today = new Date(); System.out.println(today); } }The "Hello World" Application
class HelloWorldApp { public static void main (String args[]) { System.out.println("Hello World!"); } }
The Anatomy of a Java Application |