Java Reference
In-Depth Information
has become one of the most popular languages used in programming today.
Java is an object-oriented programming language with syntax and keywords
almost identical to C++, another object-oriented language that has been used
extensively for over 20 years.
So why learn a new programming language that is similar to an established
programming language? First of all, Java is easier to learn than other object-
oriented languages. When developing Java, its creators took all of the good
features of the existing object-oriented programming languages such as C++,
Ada, and Smalltalk, and removed most of their flaws and peculiarities. There
are a lot of aspects of the Java language that are consistent and make sense,
thereby making it easier to learn.
When I first learned C++ in college, we spent weeks learning just to manip-
ulate and display strings. It was hard to remember which function to use
when, and none of it ever made any sense to me. When I first started to learn
Java, I was immediately impressed with the ease with which strings are han-
dled. It was one of the first simplicities of Java that got me excited about the
language.
I want to emphasize that I did not say Java is easy to learn. I said Java is
easier to learn than other object-oriented programming languages,
specifically C++. You still have some work ahead of you, but I think you
will find that Java is straightforward, powerful, well designed, and an
enjoyable language with which to program.
The Java Virtual Machine
The elegance and power of how Java is designed is only part of the reason why
Java has become so prevalent in today's software development. Platform inde-
pendence is what Sun boasts the loudest about regarding Java—and with
good reason!
A Java program can be written once and then run on many different devices.
Sun uses the slogan “write once, run anywhere.” I used the term boast because
the validity of the claim to true platform independence has been argued by
some; however, in an ideal situation, most Java programs can be moved from
one device to another without any modifications to the code.
For example, suppose that you want to develop a program that is to run on
a PC with Microsoft Windows and a hand-held PC running the Palm OS.
These two platforms have little in common. If you were to write this program
using a language other than Java, you would likely write the program twice—
once for Windows, and again for the Palm version. The programs would prob-
ably look quite different, and possibly would be written in different languages.
Search WWH ::




Custom Search