Java Reference
In-Depth Information
Java was designed to be safe and portable, benefiting both Internet users and
students.
Because Java was designed for the Internet, it has two attributes that make it very
suitable for beginners: safety and portability. If you visit a web page that contains Java
code (so-called appletsȌsee Figure 6 for an example), the code automatically starts
running. It is important that you can trust that applets are inherently safe. If an applet
could do something evil, such as damaging data or reading personal information on
your computer, then you would be in real danger every time you browsed the WebȌ
an unscrupulous designer might put up a web page containing dangerous code that
would execute on your machine as soon as you visited the page. The Java language has
an assortment of security features that guarantees that no evil applets can run on your
computer. As an added benefit, these features also help you to learn the language
faster. The Java virtual machine can catch many kinds of beginners' mistakes and
report them accurately. (In contrast, many beginners' mistakes in the C++ language
merely produce programs that act in random and confusing ways.) The other benefit of
Java is portability. The same Java program will run, without change, on Windows,
UNIX, Linux, or the Macintosh. This too i s a requirement for applets. When you visit
a web page, the web server that serves up the page contents has no idea what computer
you are using to browse the Web. It simply returns you the portable code that was
generated by the Java compiler. The virtual machine on your computer executes that
portable code. Again, there is a benefit for the student. You do not have to learn how
to write programs for different operating systems.
10
11
Search WWH ::




Custom Search