Throughout the course you will develop applets and applications that put your newfound Java knowledge to the test.
You will be asked to submit your exercises at different stages of development. Flip through the images below to see some of the programs you will be developing:
Course Projects Slide Show
An image is displayed in the SlideShow applet.
Another image is displayed as part of the Slide Show applet.
A factoid is read from a text file and displayed in the Factoid applet.
The Fact or Fiction network server is started.
The Fact or Fiction client communicates with the server to display trivia questions and answers.
Examining the types of Java applications
There are several types of Java applications. These types have allowed Java to flourish in a number of different areas and contributed to Java becoming a very popular programming language. Java is used to develop the following:
Console and window applications
Server-based web applications supported by Servlets, JSPs, JSF, and other JEE standards
Applets that execute within a browser
Embedded applications
Componentized building blocks using JavaBeans
While a basic understanding of the types of Java applications is useful in putting Java into context, it also helps to be able to recognize the basic code for these applications. You may not completely understand all of the ins and outs of these application types, but it is useful to see simple code examples.
Reading the code goes a long way towards understanding a language and a specific program. Throughout the book we will use numerous examples to illustrate and explain various aspects of Java. The basic types of Java applications are shown below by presenting short code snippets that are central to that application type.
Java Applets
A Java applet is a small application which is written in Java and delivered to users in the form of bytecode.
The user launches the Java applet from a web page, and the applet is then executed within a Java Virtual Machine in a process separate from the web browser itself. A Java applet can appear in a web page, a new application window, using the appletViewer.
The appletviewer command connects to the documents or resources designated by urls and displays each applet referenced by the documents in its own window. Java applets were introduced in the first version of the Java language released in 1995.
A program or application is a set of instructions targeted to solve a particular problem that can be unambiguously understood by a computer.
To this end, the computer will translate the program to the language it understands, which is machine language consisting of 0s and 1s. Computers execute a program literally as it was programmed, nothing more and nothing less. Programming is the activity of writing or coding a program in a particular programming language. This is a language that has strict grammar and syntax rules, symbols, and special keywords. People who write programs are commonly referred to as programmers or application developers. The term software then refers to a set of programs within a particular business context.