Java is an object oriented and structured programming language, designed by Sun Microsystems in the year 1991.Java is a third generation programming language. It has an in built application interface which has the ability to handle the graphics and user interfaces that creates the applets or applications.
The very advantage of java is its “portability”, the programmer can write the program and compile in the same kind of environment as it is written and after that it can be run anywhere.
Java relates to both C and C++, it uses the syntax of C and the object oriented concepts from c++ and this makes Java appealing. When a source code is given as the input, the output from java compiler is the “bytecode”. Bytecode contains set of instructions which will be executed by Java Virtual machine (JVM). In a more simple way, I can say JVM interprets the bytecode and this is the reason that java can be run anywhere. Applets are the programs which are embedded in to web page and can be executed where as the applications are directly executed by JVM.
It is not always possible to compile the complete program at the same time, so java uses just-in-time compiler to compile a set of bytecodes in real time for execution and the remaining codes will just be interpreted and thus makes the execution of Java program faster. The two main building blocks of java programming are the classes and objects. Objects are the instance of class and class is a template for creating objects.
Unlike in c/c++ you need not manually allocate/de allocate dynamic memory, java itself does this and also it has garbage collection for the unused objects. Java program handles the run time errors too. Java supports multithreaded programming.
To summarize Java is easy to use, write and to compile, it is robust, platform –independent, distributed, interpreted and secure.