Sunday, November 30, 2008

Java and its features

What is Java?

Java is a powerful object oriented programming language whose syntax is similar to C, C++.
Java is a platform independent and requires just a Java Virtual Machine to be installed in the machine to be able to run the Java applications to run on the machine.
Java sticks more strictly to the object oriented principles by static binding of objects and providing Exception handling mechanism by giving Exception handling classes.
Java codes can be written in a simple notepad application also, so we can open the Java application source code and read or edit it.

Some features of Java are:

Simple: The structure of Java is a cleaner version of C++ wherein we needed structures, pointers, operator overloading, unions, header files, virtual base classes etc. Apart from this Java was built with the basic purpose of making small stand alone software which makes it simpler.

Architecture neutral: The compiled code generated by Java compiler can be executed in any processor. The compiler does this by generating byte code which has nothing to do with the architecture of the machine. It’s the java runtime that converts this byte code to native code on the fly.

Object oriented: The features of Java make it an object oriented programming language. The smallest programmatically building block of a java program is a class. No method or data structure can exist or can be accessed outside the class definition at runtime.

Portable: There are java libraries available which make the java code portable on any platform. Like there is an abstract window class and its implementation for UNIX, windows and Macintosh operating system.

Distributed: In Java we have a set of libraries that support TCP/IP protocols such as HTTP and FTP which make accessing file system in the internet an easy affair. Apart from this Java also supports RMI (Remote Method Invocation) that makes accessing remote file system also an easy job.

Multithreaded: Java gives a better real time, interactive and responsive behavior using multithreading. Implementing multithreading in java is a very simple task.

Dynamic: Java is dynamic in the sense that new functions can be added to the libraries or classes without actually bothering the client. Apart from this it is very easy to get runtime information in Java.

Robust: Java detects many possible problems at compile time itself along with checking errors at runtime which makes Java more robust. Also Java eliminates the possibility of memory overwriting or corrupting data by following a pointer model.

Secure: Java is a secure language as it allows the Java code to execute only in the Java environment and not allowing it access to other part of the computer.

Interpreted: The Java byte code can be executed on the fly on any machine on which the Java interpreter has been shipped to.

High performance: Just in time compilation technique make java a high performance programming language. The “Just in Time” (JIT) compilers convert the byte code to native code as and when needed. Also it maintains a cache of these codes that makes it faster to access the codes that have been compiled previously as they are called again and not compiled each time they are called. This improves the performance tremendously.
Apart from this, the major advantage of using java is that it has an automatic garbage collection technique which is automatically called by the JVM when the need arises.

No comments: