|Developed by||Sun Microsystems||Netscape|
|Basic||Statically typed||Dynamically typed|
|Type of objects||Class-based||Prototype-based|
|Object encapsulation||Effective||Does not provide|
|Presence of namespace||Used in Java.||Does not contain namespaces|
|Multithreading||Java is multithreaded.||No provision for multithreading.|
Definition of Java
Java is a general-purpose object-oriented programming language designed with the intention of producing a code where the same code could be used anywhere. James Gosling of Sun Microsystems guided the development of Java in late 1990’s. This programming language is class-based, object-oriented and human readable. Java is compiled as well as interpreted. Java compiler transforms the source code into bytecode then java interpreter produces machine code which is straightly executed by the machine in which java program is running. It is reliable, distributed, portable. It could be used for developing stand-alone applications or web-based applications.
Features of java:
- Compiled and interpreted: In the beginning, Java compiler translates the source code into bytecode. Then machine code is produced which can be straightly executed by the machine, and interpreter is responsible for doing this.
- Platform independent and portable: It can be moved from one machine to another, any modification in the operating systems, system resources and processor could not affect the java programs. The bytecode generated by a java compiler could be employed on any machine.
- Object Oriented: Java is purely object-oriented language where everything revolves around the classes and objects.
- Robust and Secure: Java prevents the threat of virus and misuse of resources. It consists of a garbage collector and employs exception handling to eliminate the errors and risk of crashing.
- Distributed: It also enables the creation of applications on the network and can share both data and program. Java can also be used to access remote objects through the internet and allows several programmers to work in tandem from different remote locations.
- Multithreaded and interactive: It assists multithreaded programs where multiple tasks can be handled concurrently.
- Dynamic and Extensible: The new classes, objects, methods and libraries are probably dynamically linked in java. It can also support functions written in languages such as C and C++.
- Ease of development: Code reusability make development easier.
- Scalability and Performance: The scalability and performance can be improved by enhancing the start-up time and minimizing the consumption of memory in java runtime environment.
- Client-side scripting language: It is client-side scripting language which uses a browser to execute the code, and doesn’t involve server interaction. However, the newer versions and frameworks enable server-side scripting also.
- Event-based: It is able to run some specific code in the occurrence of some event. An event can be any loading page or submitting a form, etcetera.