Home arrow Java & J2EE arrow Page 7 - The Genius of Java

Portability and Security Through Bytecode - Java

In this first chapter from the book The Art of Java by Herbert Schildt and James Holmes, the authors highlight certain features of the Java programming language that separate it from other languages. The chapter also covers: memory management, Java's built-in support for multithreading, Java's approach to exceptions as compared to C++, Java's support of polymorphism, and how bytecode enables Java's "Write Once, Run Anywhere" ability and provides security. (ISBN 0-07-222971-3, McGraw-Hill/Osborne, 2003).

TABLE OF CONTENTS:
  1. The Genius of Java
  2. Simple Types and Objects - The Right Balance
  3. Memory Management Through Garbage Collection
  4. A Wonderfully Simple Multithreading Model
  5. Fully Integrated Exceptions
  6. Streamlined Support for Polymorphism
  7. Portability and Security Through Bytecode
  8. The Richness of the Java API
  9. The Applet, and The Continuing Revolution
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 69
May 05, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Despite all of its powerful features, Java may not have been much more than a footnote in programming history if it were not for one important but nearly transparent part of the language: bytecode. As all Java programmers know, the output of the Java compiler is not machine code that can be directly executed by a CPU. Instead, it is a highly optimized set of portable instructions, called bytecode, which are executed by the Java Virtual Machine (JVM). The original JVM was simply an interpreter for bytecode. Today, the JVM also applies on-the-fly compilation of bytecode into executable code. Whatever process is used to execute bytecode, its advantages are enormously important to the success of Java.

The first advantage is portability. By compiling a Java program into bytecode, it can be executed on any computer, with any type of CPU (and operating system) as long as a JVM is available for that environment. In other words, once a JVM has been implemented for a specific environment, any Java program can run in that environment. It is not necessary to create a separate executable for each different environment. The same bytecode can be run in all environments. Therefore, through the use of bytecode, Java offered programmers the ability “to write once, run anywhere.”

The second advantage achieved by bytecode is security. Because execution of the bytecode is under the control of the JVM, the JVM can prevent a Java program from performing malicious acts that affect the host machine. The ability to ensure the security of the host computer was crucial to the success of Java because it enabled the creation of the applet. Because an applet is a small, dynamically downloaded program that comes across the Internet, some mechanism to prevent applets from doing harm was necessary. The combination of bytecode and the JVM provided the mechanism by which applets could be downloaded safely. Frankly, without bytecode, the Web would be a much different place today.

Remember: this is chapter one of The Art of Java, by Herbert Schildt and James Holmes (McGraw-Hill/Osborne, ISBN 0-07-222971-3, 2003). Check it out at your favorite bookstore today.  
Buy this book now.



 
 
>>> More Java & J2EE Articles          >>> More By McGraw-Hill/Osborne
 

blog comments powered by Disqus
   

JAVA & J2EE ARTICLES

- More Java Bugs Lead to More Attacks
- Oracle's Java One Brings News, Surprises
- Oracle Patches Java Runtime Environment
- Apple Syncs Java Update with Oracle
- Spring 3.1 Java Development Framework Compat...
- Jelastic Java PaaS Availability and Pricing ...
- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins

Developer Shed Affiliates

 



© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap

Dev Shed Tutorial Topics: