Java is an object oriented language and developed by Sun Microsystems in 1991 in USA. Java is object oriented language. And use to develop the windows applications and web applications.
The source code of java program is saved in a text file with ‘.java’ extension. Syntactically java is similar to c, c++ syntax. However java does not support the concept of pointers as compare to c, c++.
Some of the features of java are as follows:
1. Object oriented: java is a true object oriented language as compare to c++ because all of the data and code is resides within the classes and objects.
2. Interpreted and compiled: java is a interpreted and compiled language. Java has the features of both techniques. And this makes it unique from other languages. Java compiler translates the code to ‘bytecode’, and then java interpreter generates the machine code.
3. Secure: java is a more secure language then the other languages because it provides security from internet threats like viruses. And java is not has the concept of the pointers this makes it secure from unauthorized access of memory locations.
4. Platform independent: Java is a platform independent language. It is also an important feature of this language. A java program can easily transfer from one machine to another without any hardware problem.
Java compiler
Java has a compiler named JAVAC that reads the source code from the text file having extension ‘.java’ and translate it into byte code. This byte code is load in a class file that is file with extension ‘.class’. if the compiler detects any rule violation it will display one or more error messages and stop the compilation process.
Source file (*.java) |
Byte code (*.class) |
Compiler JAVAC |
JVM (java virtual machine)
JVM is a program that interprets each byte code instruction, selects a set of computer specific instruction that corresponds to each bytecode instructions, and runs this set of instructions.
Run (*.class) |
Byte code (*.class) |
Java virtual machine (JVM) |
Virtual machine program often contains code that serves as virtual machine operating system. This code is known as run time environment virtual machine of java makes java platform independence. While the virtual machine interprets the byte code, it communicates with the run time environment to perform variety of computer specific tasks such as:
- Allocating memory
- Accessing files
- Display information on monitor etc
JDK (java development kit)
The JDK is a Sun’s tool kit for creating java software. It contains useful tools such as:
1. Compiler
2. Virtual machine
3. Class library
4. Documentation
5. Sample of examples
These various tools are known as command line tools because they run from command line interpreter like DOS, UNIX.
There are many versions of JDK since 1995. It includes version from the original release 1.0.1 to current release 6.0. The java development kit includes the followings:
1. Javac: The java compiler.
2. Javah: For c header file.
3. Jdb: java debugger.
4. Javadoc: The java documentation program.
5. Java: The java virtual machine.
6. Applet viewer: The java applet viewer.