Java Introduction

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).

Uses of Java

Java is not mere a programming language but a technology. Java technology includes:

  • A programming language.
  • A development environment
  • An application environment
  • A deployment environment

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.

  • JRE provided by Java 2 Software Development Kit (J2SDK) contains set of class files for all java technology packages which includes basic language classes, classes for GUI and so on.
  • Other one is provided by our web browser. Most web browsers provides a java technology interpreter and a runtime environment.

History of Java

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!

Features of Java

Java has several features which make it above par. We are going to discuss some common and important features here.

Simple :

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

Object Oriented :

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.

Platform Independent :

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 Runtime Environment (JRE).
  • Application Programming Interface (API).
source-file-java
Byte-codes which are generated can run on any Machine which has the JVM and are secure because JVM itself checks the code at runtime.

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.

Secure :

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.

JVM Provides

  • Class loader: - In this adds security by separating the package for the classes of the local file system from those that are imported from network sources.
  • Byte-code Verifier: - that is checks the code fragments for illegal code that can violate access right to objects.
  • Security Manager: - its determines what resources a class can be access such as reading and writing to the local disk.

    These security are provided by java language. Some security can also be provided by application developer through like- SSL, JAAS, cryptography etc.

Robust :

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.

Distributed :

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.

Portable :

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).

Multi-Threaded:

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.

High Performance :

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 Architecture

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 java-architecture

About Author

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.

Share this Article Facebook
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions

Recent Addition

new tutorial Protractor Online Training : We have closed registration for training

Please do email to chercher.tech@gmail.com for any queries

If you already registered then please do check your email for the Webex link for the training starting from 15th Nov 2018
 
Join My Facebook Group
Join Group