Introduction to Java

JAVA

Brief History

Developed by Sun Microsystems in 1991.Initially called Oak.Renamed Java in 1995.Between 1992 and 1995 it was worked upon which culminated in the evolution of Java in its modern day form.

Why Java?

The following two impetuses pushed for the development and design of Java as we see it today;

1-Need for a platform independent language:

C and C++ are designed to be compiled for a specific target.A program written in these could well compile for any type of CPU but it demanded for a CPU-specific compiler.Java was designed to be portable and platform-independent that could run code on a variety of CPUs under different architecture environment.

2-World Wide Web:

Portability problem arose again with the advent of Internet as many kinds ofplatforms are attached to Internet.This had become a high-profile priority.Thus the issue of different platforms being able to run the same program pushed for further advancement in Java.

Bytecode-essence of Java

Bytecode is a non-executable code designed to be executed by Java Virtual Machine(JVM).
JVM provides a run-time system to execute the bytecode irrespective of the platform in which it(JVM) is implemented.This is how Java is rendered portable and secure as only the JVM is in charge of the execution environment and it is platform independent.

Character of Java:

Java derives much of its character from C and C++.Java was designed not to replace these but to add advanced features concerning art of programming and adaptation to changes in environment.However the baseline for Java
remains the Object-oriented programming (OOP).While process-oriented model (implemented by C)
can be visualised as code controlling data, OOPS is data controlling access to code.
OOP defines the following four concepts;

1-Abstraction:
Hiding the unessentials details from the user explains abstraction. The user is confined to dealing with objects and classes.

2-Encapsulation:
This relates to binding together of code and data to keep them safe.These are the members of a class.The complexity of how a code executes is encapsulated by marking these members as private or public.

3-Inheritance:
It is the process by which an one object acquires the properties of another.This forms a subclass which can be instantiated to become a specific instance of a more general case.

4-Polymorphism:
Allows one INTERFACE to be used for a general class of actions.It gives way to method overloading and method overriding cutting down on the need to use concrete implementation.