Java Reference
In-Depth Information
Java also enables you to write large-scale application programs that you can run unchanged on any com-
puter with an operating system environment in which Java is supported. This applies to the majority of com-
puters in use today. The slogan that was coined to illustrate the cross-platform capability of Java, “write
once, run anywhere,” has been amply demonstrated to be the case. You can develop code on a PC and it will
run on a Java-enabled cell phone. You can even write programs that work both as ordinary applications and
as applets.
Java has matured immensely in recent years. The breadth of function provided by the standard core Java
has grown incredibly. Java provides you with comprehensive facilities for building applications with an in-
teractive graphical user interface (GUI), extensive image processing and graphics programming facilities, as
well as support for XML, accessing relational databases and communicating with remote computers over a
network. Just about any kind of application can now be programmed effectively in Java, with the implicit
plus of complete portability.
Of course, Java is still developing and growing. The latest Java Development Kit, JDK 7, adds many new
facilities that include new language features as well as significant additions to the supporting libraries. You
learn about all of these in this topic.
FEATURES OF THE JAVA LANGUAGE
The most important characteristic of Java is that it was designed from the outset to be machine independent.
You can run Java programs unchanged on any machine and operating system combination that supports
Java. Of course, there is still the slim possibility of the odd glitch, as you are ultimately dependent on the
implementation of Java on any particular machine, but Java programs are intrinsically more portable than
programs written in other languages. An application written in Java only requires a single set of source code
statements, regardless of the number of different computer platforms on which it is run. In any other pro-
gramming language, the application frequently requires the source code to be tailored to accommodate dif-
ferent computer environments, particularly if an extensive graphical user interface is involved. Java offers
substantial savings in time and resources in developing, supporting, and maintaining major applications on
several different hardware platforms and operating systems.
Possibly the next most important characteristic of Java is that it is object-oriented . The object-oriented
approach to programming is an implicit feature of all Java programs, so you find out what this means later
in this chapter. Object-oriented programs are easier to understand and less time-consuming to maintain and
extend than programs that have been written without the benefit of using objects.
Not only is Java object-oriented, but it also manages to avoid many of the difficulties and complications
that are inherent in some object-oriented languages, making it easy to learn and very straightforward to use.
By and large, it lacks the traps and “gotchas” that arise in some other programming languages. This makes
the learning cycle shorter, and you need less real-world coding experience to gain competence and confid-
ence. It also makes Java code easier to test.
Java has a built-in ability to support national character sets. You can write Java programs as easily for use
in Greece or Japan as you can for English-speaking countries, assuming you are familiar with the national
languages involved, of course. You can even build programs from the outset to support several different na-
tional languages with automatic adaptation to the environment in which the code executes.
Search WWH ::




Custom Search