O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.10. Sample Java Application

An application is what is normally called a program: source code that is compiled and directly executed. In order to create an application in Java, the program must have a class that defines a method called main. The main() method in the class is the starting point for the execution of any application.

Essential Elements of a Java Application

Example 1.4 is an example of an application in which a client uses the CharStack class to reverse a string of characters.

Example 1.4. An Application
 // Source Filename: Client.java public class Client { public static void main(String[] args) { // Create a stack CharStack stack = new CharStack(40); // Create a string to push on the stack String str = "!no tis ot nuf era skcatS"; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required