By Monica Pawlan
If you are new to programming in the Java language, have some experience with other languages, and are familiar with things like displaying text or graphics or performing simple calculations, this tutorial could be for you. It walks through how to use the Java 2 Platform software to create and run three common types of programs written for the Java platform—applications, applets, and servlets.
You will learn how applications, applets, and servlets are similar and different, how to build a basic user interface that handles simple end user input, how to read data from and write data to files and databases, and how to send and receive data over the network. This tutorial is not comprehensive, but instead takes you on a straight and uncomplicated path through the more common programming features available in the Java platform.
A Word About the Java Platform
The Java platform consists of the Java application programming interfaces (APIs) and the Java virtual machine (JVM).
The Java platform consists of the Java application programming interfaces (APIs) and the Java virtual machine (JVM).
Java APIs are libraries of compiled code that you can use in your programs. They let you add ready-made and customizable functionality to save you programming time.
The simple program in this lesson uses a Java API to print a line of text to the console. The console printing capability is provided in the API ready for you to use; you supply the text to be printed.
Java programs are run (or interpreted) by another program called the Java VM. If you are familiar with Visual Basic or another interpreted language, this concept is probably familiar to you. Rather than running directly on the native operating system, the program is interpreted by the Java VM for the native operating system. This means that any computer system with the Java VM installed can run Java programs regardless of the computer system on which the applications were originally developed.
For example, a Java program developed on a Personal Computer (PC) with the Windows NT operating system should run equally well without modification on a Sun Ultra workstation with the Solaris operating system, and vice versa.