Java is an object oriented programming language that introduced by Sun Microsystems in 1995. It is a high level programming language which was designed to be small, simple, and portable across platforms and operating systems, both at the source and at the binary level.
It was designed to have the "look and feel" of the C++ language, but it is simpler to use than C++ and enforces an object-oriented programming model. Java is used to create complete applications that may run on a single computer or be distributed among servers and clients in a network.
It is also be used to build a small application module or applet for used as part of a Web page. Applets that make it possible for a Web page user to interact with the page. Java is general purpose programming language with a number of features that make the language well suited for use on the World Wide Web (WWW).
Java is not mere a programming language but a technology. Java technology includes:
As A Programming Language, Java can create any kind of application ranging from (stand-alone application to distributed application) which can be created using any other conventional programming languages.
As A Development Environment, Java provides an extensive set of tools which help us in development of applications. Some common examples are, A compiler (javac), An Interpreter (Java), A documentation tool (Javadoc), A class file packaging tool etc.
As An Application and Runtime Environment, Application developed using java technology are designed in such a manner so that it can run on any platform (hardware and software configuration) where Java Runtime Environment (JRE) is installed. There are two main deployment environment.
In 1991, a team of Sun Microsystems engineers (Green Team) led by James Gosling decided to develop a language for consumer devices (cable boxes, etc.).
They want that language to be small and use efficient code since these devices do not have powerful CPUs. They also want the language to be hardware independent since different manufacturers would be use different CPUs.
The project was code-named Green. These conditions led them to decided to compile the code to an intermediate machine-like code for an imaginary CPU it is called a virtual machine. (Actually, that is a real CPU that implements this virtual CPU now.)
This intermediate code (called byte-code) is completely hardware independent and Programs are run by an interpreter that converts the byte-code to the appropriate native machine codes.
Thus, once the interpreter has been ported to a computer, it can run any byte coded program. Sun used UNIX for their computers, so the developers based their new language on C++ base.
They picked C++ and not C because they wanted the language is to be object-oriented. The original name of the language was Oak. they soon discovered that there was already a programming language its called Oak, so they changed the name to Java.
But they were unable to get others interested in java for smart devices they started marketing java as a programming language for web. Many of the advantages which java has for smart devices are even bigger for web applications.
In 1995, team announced that the Netscape Navigator Internet browser would be incorporate Java technology.
Today, Java is not only permeates the Internet, but also is invisible force behind many of the applications and devices that power our day-to-day lives. like From mobile phones to hand-held devices, games and navigation systems to e-business solutions, Java is everywhere available!
Java has several features which make it above par. We are going to discuss some common and important features here.
According to Sun Micro-system, Java is simple as it has syntax based on C++ which is easy to write and manage with the basic knowledge of C++. Java has removed many confusing and rarely used features of C++ such as Explicit Pointers, Operator Overloading, and Multiple Inheritance etc
As java is an object oriented programming language which itself has many benefits over procedural programming makes java a suitable language for speedy and flexible software development. In java the program is organized as a combinations of objects.
Object-oriented programming (OOPs) is a methodology that simplify software development and maintenance by providing some rules like object, class, abstraction, encapsulation, polymorphism and inheritance. As we have already discussed the advantages of OOPS we can understand the advantages of java when it implements OOPS.
Java has been designed with the intent of platform independence. Here platform mean hardware and software configurations. There are two types of platform Hardware- based and Software-based. Java provides Software-based platform which runs on top of Hardware-based platform.
Java Software-based platform has two key component.
Java program File (.java) is compiled by the compiler and converted into class file (.class) which contains the byte-code which is an intermediate code language meant for a logical machine (Java Virtual Machine) provided by JRE.
The byte code can be interpreted by Just in Time Compiler (JIT) for any machine to produce native machine code. This makes java platform independent. Program written and compiled by any machine can run on any other machine such as Windows, Mac, UNIX and Solaris.
Java is WORA (Write Once Run Anywhere) language. We will be discussing more about JRE, JVM and JIT further.
Java is being considered as most secured programming language now a days. Java is secure in many ways.
It includes enforcing runtime constraints through the use of the Java Virtual Machine (JVM), a security manager that sandboxes un-trusted code from the rest of the operating system, and a suite of security APIs that Java developers can utilize .No Explicit Pointer.
Java web applications are secure as it does not allow reading and writing to local disk using web application which may produce vulnerability.
Java is Robust means that java is strong. No use of explicit pointers make it even more robust. As there was an extra overhead of dereferencing the memory occupied by a pointer. Java provides various features like strong memory management by using automatic garbage collection, strong type checking and exception handling. These capabilities of java makes it Robust.
Using java we can create distributed applications. Distributed applications are the applications which can run on client server architecture. RMI and EJB that are used for creating distributed applications. We may access files by calling the methods from any machine on the internet.
Java is portable, means we may carry java Byte-code to any platform. Java program can execute on any platform for which there is Java Virtual Machine (JVM). Java programs can be transferred over World Wide Web (e.g. Applet).
A Thread is a single execution path in a program. In java we can define multiple execution paths which can be executed concurrently by defining multiple thread in a single program. This is known as multi-threading. This improves the performance of a java application by providing better resource (CPU, Memory) utilization. . The main advantage of multi-threading is it shares the same memories. Threads are important for multi-media, Web applications etc.
As java Byte-code is native to machine code and the interpretation of it becomes faster than traditional interpretation. Byte-code is highly optimized and JVM can run them much faster.
Java combines both the approaches Compilation and Interpretation. First, java compiler (javac) compiles the java program and generates a .class file which contains byte-codes.
At the runtime Java Virtual Machine (JVM) interprets this byte-code and generates the native machine code for the machine on which java program is running. And then this machine code then be directly executed by the machine.
So Java is both compiled as well and interpreted language
Myself KarthiQ, I am the author of this blog, I know ways to write a good article but some how I donot have the skills to make it to reach people, would you like help me to reach more people By sharing this Article in the social media.