Introduction to Java
In 1996, Sun Microsystems released a new programming language called
Java. This language had some unique features that gave it great promise as a
language that could be used on all platforms for all types of applications. In the
three figures that follow, you'll learn more about this language, its features, and its
applications.
Toolkits and platforms
Figure 1-1 describes all major releases of Java to date starting with version
1.0 and ending with version 1.4. As you can see, Sun referred to versions 1.0 and
1.1 of the Java toolkit as the Java Development Kit (JDK). With version 1.2,
however, Sun began using the term Software Development Kit (SDK) to describe
the Java toolkit. In practice, these two terms are often used interchangeably. In
this book, we'll use the term SDK since it's the most current term.
All versions of the SDK since version 1.2 are referred to as Java 2 because
they all run under the Java 2 Platform. This book will show you how to use the
Java 2 Platform, Standard Edition (J2SE). Once you master the Standard Edition,
you will have all the skills you need to begin learning how to use the Java 2
Platform, Enterprise Edition (J2EE). In fact, many of the same skills apply to
both editions.
One reason that Java has become so widely used is that it can create programs
that can run on any of the operating systems shown in this figure. In addition, Java
programs can also be run under the Macintosh operating system. You'll learn
more about the details of how this works later in this chapter.
Java compared to C++
When Sun's developers created Java, they tried to keep the syntax for Java
similar to the syntax for Microsoft C++ so it would be easy for C++ programmers
to learn Java. That's one of the four features that are used for comparing Java and
C++ in this figure.
The second feature is one of the most touted Java features. Specifically, Java
is designed so its applications can be run on any computer platform. In contrast,
C++ needs to have a specific compiler for each platform that its applications are
going to run on. You'll learn more about this in figure 1-3.
The third feature, though, indicates one of the weaknesses of Java. Specifically,
the speed (or performance) of its applications is often considerably slower
than the speed of traditional applications. In fact, this is an issue that limits the use
of Java for some types of applications.
The fourth feature has to do with the use of internal memory. Specifically,
Java is easier to use than C++ because it handles many operations involving the
creation and destruction of memory automatically. This also makes it easier to
write bug-free code.
Figure 1-1 Introduction to Java
Java timeline
| Year | Month | Event |
| 1996 | January | Sun releases Java Development Kit 1.0 (JDK 1.0). |
| 1997 | February | Sun releases Java Development Kit 1.1 (JDK 1.1). |
| 1998 | December | Sun releases the Java 2 Platform with version 1.2 of the Software Development
Kit (SDK 1.2). |
| 1999 | August | Sun releases Java 2 Platform, Standard Edition (J2SE).
| | | December | Sun releases Java 2 Platform, Enterprise Edition (J2EE).
| | 2000 | May | Sun releases J2SE with version 1.3 of the SDK.
| | 2001 | April | Sun releases J2SE with version 1.3.1 of the SDK.
| | | May | Sun releases beta version of the J2SE with version 1.4 of the SDK.
| |
Operating systems supported by Sun
- Win-32 (Windows NT, Windows 95, Windows 98, Windows 2000, and Windows XT)
- Solaris (SPARC or Intel platform)
- Linux
Java compared to C++
| Feature | Description |
| Syntax | Since Sun wanted to make Java easy to learn for C++ programmers, they made the syntax
similar to the syntax for C++. |
| Platforms | After a Java program has been compiled, it can be run on any platform that has a Java
interpreter (see figure 1-3). In contrast, a C++ program needs to be compiled once for each
type of system that it is going to be run on. |
| Speed | C++ runs faster than Java, partly because it is compiled for a specific platform, but Java is
getting faster with each new version. |
| Memory | Since most memory operations are handled automatically by Java, it's easier to write bug-free
code with Java than it is with C++. |
|
Description
- Versions 1.0 and 1.1 of the Java toolkit were called the Java Development Kit, or JDK.
- Versions 1.2 through 1.4 of the Java toolkit are called the Software Development Kit, or SDK.
- The Java 2 Platform, Standard Edition, or J2SE, supports versions 1.2 through 1.4 of the SDK.
- The Java 2 Platform, Enterprise Edition, or J2EE, can be used to create enterprise-level, server-side applications.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.