Definition of Java in The Network Encyclopedia.

What is Java?

An object-oriented programming language developed by Sun Microsystems. Java is syntactically related to the C and C++ programming languages but is simpler, has libraries that are tuned for the Internet environment, and is designed to be portable across different operating systems and platforms. Java code can be reused and extended through inheritance, which simplifies the development process.

You can use Java to develop full-fledged distributed applications and application suites, but much of its appeal comes from its ability to create applications called “applets” that can be downloaded from Web servers by standard Web browsers and then executed on the client browser. These applets can add various interactive features to Web sites to enhance the user’s experience and provide features such as rotating ad banners or animated stock tickers.

How it works

After you write an application (or applet) in Java, a Java compiler takes your source code (which is usually saved with the extension .java) and compiles it into something called bytecode. Bytecode is not true machine code - it is a set of generic instructions that are not specific to any particular hardware platform or operating system. Bytecode files generally have the extension .class and are referred to as class files. Here is a simple example of a Java application called

Class HelloThere {
Public static void main (String args[]) {
System.out.println("Hello there");

The program defines a new class called HelloThere and contains only one method: main(). When this program is compiled into the class file HelloThere.class and then run, it displays the text “Hello there” on the screen (the standard output device).

To run the application (class file), you must have a bytecode interpreter called a Java Virtual Machine (JVM) on the system. The JVM reads the bytecode of your application and executes it by converting each bytecode instruction into a machine-native instruction or set of instructions. This translation process takes place regardless of whether the particular piece of bytecode has been previously executed. If the application is an applet, the Web browser that accesses it must have a JVM installed in it. The use of a bytecode interpreter instead of a “true” compiler, which generates platform-specific machine code, means that applications written in Java are often slower than those written in C or C++, but the ease of development and portability of code offset these disadvantages in most cases. To obtain additional functionality, you can link native code to Java applications.

The JVM has special security features built into it to ensure that any malicious Java applet downloaded from the Internet cannot perform any harmful actions on the user’s system. In this sense, you can consider the JVM running in the Web browser a “sandbox” that allows the applet to safely “play around” (execute) while preventing access to certain items, such as the client machine’s file system.

An alternative to the JVM is a just-in-time (JIT) Java compiler that dynamically compiles segments of Java bytecode into equivalent segments of platform-specific executable machine code at run time. JIT compilers offer better performance than the JVM for running Java applications, especially in applications in which segments of code run multiple times (for example, in loops).


Other components of the Java platform include the following:

  • JavaBeans, the Java component architecture for developing Java applications. JavaBeans can be self-contained applications or portions of Java applications. You can use them as building blocks for creating more complex programs.
  • Java Foundation Classes (JFC), which are building blocks for creating interfaces for Java applications.
  • Java Database Connectivity (JDBC), which provides standard application programming interfaces (APIs) for connecting SQL (Structured Query Language) databases to Java applications.
  • JavaOS, an operating system designed to natively run Java programs.

Web References