What is JAVA?
JAVA technology is both a programming language and a platform.
The Java programming language is the language in which Java applications, applets, servlets, and components are written.
The Java platform is the predefined set of Java classes that exist on every Java installation; these classes are available for use by all Java programs. The Java platform is also sometimes referred to as the Java runtime environment or the core Java APIs (application programming interfaces).
History of Java
‘B’leads to ‘C’ evolved into ‘C++’ sets the stages for ‘Java’
In 1990, Sun Microsystems began a project called Green Project to develop software for consumer electronics. James Gosling, a veteran engineer was assigned to the new Green Project.
Gosling began writing software in C++ for embedding into such items as toasters, VCRs etc. But soon he realized that C++ was the wrong tool for the job as it is susceptible to bugs that can crash the system. Gosling’s solution to the problems of C++ was a new language called Oak.
Oak preserved the familiar syntax of C++ but omitted the potentially dangerous features like explicit resource references, pointer arithmetic and operator overloading, etc.
When the World Wide Web became popular in 1994, Sun realized that Oak was the perfect programming language for the Web. Thus in 1994, they completed work on a product known as Web Runner was later renamed as Hot Java. Finally, in 1995, Oak was renamed Java and the team announced that the Netscape Navigator Internet browser would incorporate Java technology.
Features of Java
Automatic Memory Management and Garbage Collection
Advantages of Java
Fewer bugs and reusable code
We need to write less code
Avoid platform dependencies. (Write once, run everywhere)
Automatic version check
Working of Java
Working of JAVA on Internet
JAVA Platform, JDK, JRE
Java Platform – A platform is a h/w or s/w environment in which a program runs. Most platforms can be described as a combination of the operating system and underlying architecture. The Java platform differs from others in that it’s a s/w only platform that runs on the top of other h/w based platforms.
JDK – Java Development toolKit is a bundle of s/w to develop java based applications.
JRE – Java Runtime Environment is an implementation of JVM to execute java programs. JRE consists of two components:
The Java Application Programming Interface (API)
JVM – Java Virtual Machine
a virtual machine (VM) is a s/w implementation of a machine (computer) that executes programs like a real machine.
A ‘.class’ file does not contain code that is native to our processor. It instead contains bytecodes – the machine language of the JVM. The Java launcher tool then runs our application with an instance of the JVM.
Because the JVM is available on many different operating systems, the same ‘.class’ files are capable of running on different platforms.
the API is a large collection of readymade s/w components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces ; these libraries are known as packages.
Steps to create and execute a Java program
Creating a program using an editor
Compiling a Java Program into Byte codes
Loading a Program into Memory
Byte code Verification
Java Versions & Environments
Till now Java has undergone three significant version changes.
It was first launched as Java 1.0, which is still extensively supported by a majority of browsers.
Then came Java 1.1, which had a language enhancements, an improved user interface, and event handling.
Finally Sun has come up with the latest version as Java 1.2.2 which it calls “Java 2”.
Java is available in many environments. Java software is most easily available as JDK (Java Development Toolkit) version 1.0, 1.1 or 1.2.
There are many other development environments for Java.Some of them are:
Symantec Visual Café
Visual Java (VJ++)