About NewTechnoBuzz
Contact Us

Sunday, July 6, 2014

Java Overview & its Features

This article presents a quick overview of several key features of Java. The material described here will give you a foothold that will allow you to write and understand simple programs.

Object-oriented programming (OOP) is at the core of Java. In fact, all Java programs are to at least some extent object-oriented. OOP is so integral to Java that it is best to understand its basic principles before you begin writing even simple Java programs.

Java have so many features which are as -


The simplicity of Java means that a programmer could learn it quickly. There are various features that makes the java as a simple language. The number of language constructs has been kept small and it has a look and feel familiar to C, C++ and Objective-C. Therefore programmers can easily migrate to Java. Java does not support pointers which are a notorious source of bugs in C & C++. Eliminating of pointers simplifies the language and eliminates many potential bugs. Automatic memory allocation and deallocation is done by the garbage collector and must not be explicitly programmed.

Platform Independent
Java provides the facility to "Write once -Run any where"(Known as plateform independent). As we know, java is both compiler & interpreter based language. Once the java source code is compiled, it gets converted byte code which is portable & can be easily executed on all operating systems. This format is same on every platform like Solaris work station or Macintosh, windows or Linux. After compilation, the interpreter reads the generated byte code & translates it according to the host machine. Byte code is interpreted by Java Virtual Machine which is available with all the operating systems we install. So to port Java programs to a new platform all that is required is to port the interpreter and some of the library routines.

The object oriented language must support the characterstics of the OOPs. In an object-oriented language, you use objects and classes to organize your data. Java is a fully object oriented language . It supports all the characteristics needed to be object oriented. In, Java every thing is treated as objects to which methods are applied. As the languages like Objective C, C++ fulfills the above four characteristics yet they are not fully object oriented languages because they are structured as well as object oriented languages. But in case of java, object is at the outer most level of data structure. No stand alone methods, constants, and variables are there in java. Everything in java is object even the primitive datatypes can also be converted into object by using the wrapper class.

The widely used protocols like HTTP and FTP are developed in java. Internet programmers can call functions on these protocols and can get access the files from any remote machine on the internet rather than writing codes on their local system. Java Remote Method Invocation (RMI) allows you to write distributed objects using Java.

Java does not use memory pointers explicitly. All the programs in java are run under an area known as the sand box. Security manager determines the accessibility options of a class like reading and writing a file to the local disk. Java uses the public key encryption system to allow the java applications to transmit over the internet in the secure encrypted form. The bytecode Verifier checks the classes after loading.

Compiled and Interpreted
Java source code is compiled down to "bytecode" by the Java compiler. The bytecode is executed by Java Virtual Machine (JVM). JVM uses a technique called Just-in-time (JIT) compilation to compile the bytecode to the native instructions understood by the CPU on the fly at run time. This provides portability to any machine for which a virtual machine has been written. The interpreter program reads the source code and translates it on the fly into computations.The two steps of compilation and interpretation allow for extensive code checking and improved security.

Robust means reliable and no programming language can really assure reliability. Java puts a lot of emphasis on early checking for possible errors. Java has the strong memory allocation and automatic garbage collection mechanism. It carries out type checking at both compile and runtime making sure that every data structure has been clearly defined and typed. compiler checks the program for any error and interpreter checks any run time error that every data structure is clearly defined and typed. The memory allocation and deallocation is automatically managed by garbage collector.

The feature of java "write once -run any where" make java portable. Many type of computers and operating systems are used for programs By porting an interpreter for the Java Virtual Machine to any computer hardware/operating system, one is assured that all code compiled for it will run on that system. This forms the basis for Java's portability.

Please feel free to post any comment or question if you have. I hope that you would have a clear understanding of Java features.