What is Java

Last Edited



Definition of Java in Network Encyclopedia.

What is Java?

Java is 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.

What is Java?
What is Java?

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 does Java work?

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 HelloThere.java:

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

The HelloThere.java 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).

Java generic interface
Java generic interface

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).

History of Java

James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time. The language was initially called Oak after an oak tree that stood outside Gosling’s office. Later the project went by the name Green and was finally renamed Java, from Java coffee. Gosling designed Java with a C/C++-style syntax that system and application programmers would find familiar.

Java Green Team (History of Java)
Java Green Team

Sun Microsystems released the first public implementation as Java 1.0 in 1996. It promised to Write Once, Run Anywhere (WORA), providing no-cost run-times on popular platforms. Fairly secure and featuring configurable security, it allowed network- and file-access restrictions. Major web browsers soon incorporated the ability to run Java applets within web pages, and Java quickly became popular. The Java 1.0 compiler was re-written in Java by Arthur van Hoff to comply strictly with the Java 1.0 language specification. With the advent of Java 2 (released initially as J2SE 1.2 in December 1998 – 1999), new versions had multiple configurations built for different types of platforms. J2EE included technologies and APIs for enterprise applications typically run in server environments, while J2ME featured APIs optimized for mobile applications. The desktop version was renamed J2SE. In 2006, for marketing purposes, Sun renamed new J2 versions as Java EEJava ME, and Java SE, respectively.

Starting with Java

Learn the basics of Java with this video tutorial


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