-->
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Wednesday, May 17, 2017

Introduction to Java

History of Java

Java is a high-level language, developed by James A. Gosling from Sun Microsystems in 1991. The first version of Java was released in 1995 and today it is supported on a broad range of platforms. Sun Microsystems was acquired by Oracle in 2010 and now has the control for Java. In 2006 Sun started to make Java available under the GNU General Public License (GPL). Oracle continues this project called Open JDK.

Features of Java
1. Object Oriented Programming(OOP)
2. Portable
3. Platform Independent
4. Secure and Robust
5. Architecture Neutral
6. Dynamic
7. Interpreted language
8. Automatic Memory management
9. Multi-threaded
10. Strongly Typed


Object Oriented Programming(OOP)
Object Oriented programming is an approach based on the concept of 'Object'. This was adopted to eliminate the drawbacks of Procedure oriented programming (POP). In this approach, the emphasis is given on data rather than procedure. Data does not flow freely from function to function. It is tied with a function that operates on it and prevents unwanted modification by other functions. To follow this approach, the whole problem is divided into small entities called 'Objects'. The combination of data and the functions(which will operate on it) together make an object.


Portability
It works on the principle of WORA(Write Once Run Anywhere). This is one of the main reasons for its popularity. This provides flexibility to the program to be moved from one system to another. Any changes in Operating System, Processor Architecture and resources would not affect our java program.

Platform Independent and Architecture Neutral

Platform independent means a java program compiled on a particular platform works neatly on any other platform without the need of any modification. Behind the scenes, java program runs on JVM or Java virtual Machine which itself is not platform independent and acts as an intermediate between OS and user. It is also neutral to architecture, unlike C and C++.  For Example in C and C++ integer variable are assigned 2 OR 4  bytes depending upon 32-bit or 64-bit architecture. In Java, integers are assigned 4 bytes irrespective of the architecture.


Secure and Robust
Any technology if it is good at two main areas it is said to be ROBUST                                              
➤Exception Handling                                              
➤ Memory Allocation  
JAVA is Robust because 
A. JAVA is having very good predefined Exception Handling mechanism whenever an exception occurs.
B. JAVA is having a very good memory management system that is Dynamic Memory (at runtime the memory is allocated) Allocation which allocates and deallocates memory for objects at runtime.

Java is secure because:
i) No direct memory access
ii)Security on API level
iii)Runs inside JVM
iv)No use of pointers for memory management
v)Automatic bound checking on arrays.
vi)Has many access specifiers(Public, Private, Protected) which enable developers to restrict data flow


Dynamic
It is a dynamic language. Java is capable of dynamically linking in library files, methods, and objects.


Automatic Memory Management
Java runs has an inbuilt garbage collection system. Garbage collection is the process of identifying and deleting the objects which are no longer in use from heap memory.It allows programmers to create new objects without worrying about their memory de-allocation.In C and C++ the process of memory de-allocation is manual. In C it is done by free() and C++ uses 'delete'.

Multi-threaded
As you already know that an OS can execute multiple programs simultaneously. This is technically known as multithreading.
In this model, a program is divided into two or more subprograms which can be implemented in the same time in parallel.

No comments:

Post a Comment