Java Reference
In-Depth Information
Chapter 1
Introducing Java
WHAT YOU WILL LEARN IN THIS CHAPTER:
• The basic characteristics of the Java language
• How Java programs work on your computer
• Why Java programs are portable between different computers
• The basic ideas behind object-oriented programming
• How a simple Java program looks and how you can run it using the Java Development Kit
• What HTML is and how to use it to include a Java program in a web page
This chapter should give you an appreciation of what the Java language is all about. Understanding the details
of what I discuss in this chapter is not important at this stage; you see all of the topics again in greater depth
in later chapters of the topic. The intent of this chapter is to introduce you to the general ideas that underpin
what I cover through the rest of the topic, as well as the major contexts in which Java programs can be used
and the kind of program that is applicable in each context.
WHAT IS JAVA ALL ABOUT?
Java is an innovative programming language that has become the language of choice for programs that need
to run on a variety of different computer systems. First of all, Java enables you to write small programs called
applets . These are programs that you can embed in web pages to provide some intelligence. Being able to em-
bed executable code in a web page introduces a vast range of exciting possibilities. Instead of being a passive
presentation of text and graphics, a web page can be interactive in any way that you want. You can include
animations, games, interactive transaction processing — the possibilities are almost unlimited.
Of course, embedding program code in a web page creates special security requirements. As an Internet
user accessing a page with embedded Java code, you need to be confident that it won't do anything that might
interfere with the operation of your computer or damage the data you have on your system. This implies that
execution of the embedded code must be controlled in such a way that it prevents accidental damage to your
computer environment, as well as ensure that any Java code that was created with malicious intent is effect-
ively inhibited. Java implicitly incorporates measures to minimize the possibility of such occurrences arising
with a Java applet.
Java's support for the Internet and network-based applications generally doesn't end with applets. For ex-
ample, Java Server Pages (JSP) provides a powerful means of building a server application that can dynamic-
ally create and download HTML pages to a client that are precisely customized for the specific request that is
received. Of course, the pages that are generated by JSP can themselves contain Java applets.
Search WWH ::




Custom Search