Chapter 26: Java Programming

Chapter 26: Java Programming


Secrets in This Chapter

  • Downloading and Installing Java 2 SDK

  • Nonprimitive Data Types in Java

  • Arrays in Java

  • Exception-Handling in Java

  • Threads in Java

  • Java Foundation Classes (JFC) and Swing

  • The Model-View-Controller (MVC) Architecture and Swing

  • The Role of Java Servlets

  • Linking HTML Forms to Servlets

Java is an object-oriented programming language that began life as a language for embedded systems-small computers that control electronic devices. Java became popular as way of embedding small application programs called applets into the HTML code of Web pages. When the browser downloads a Web page with an applet, the browser also downloads the applet and executes that application program. To be more precise, these Java applets are transmitted as sequences of bytes that can be executed by a Java Virtual Machine (JVM) embedded in a Web browser. Thus, a Java program can be executed anywhere a JVM and the Java libraries are available.

Java's use has extended beyond applets to general-purpose applications that do not have to run inside a Web browser. Many organizations now use Java for developing mission-critical applications, including three-tiered Web applications that provide access to the corporate databases that often reside on older mainframe systems. These three-tiered Web applications use Java servlets-Java code that runs on the Web server and provides access to corporate databases through Java Database Connectivity (JDBC) application programming interface (API).

This chapter provides you an overview of the Java language and shows you a few simple examples. As you might guess, a single chapter cannot do justice to Java; all this chapter can do is get you started with Java. With that goal in mind, this chapter focuses immediately on the tools you need to create Java applications and shows you several small examples to illustrate specific Java programming techniques.