Recent Posts

Sunday, 10 April 2016

Java Language Basics

Java Language Basics

Java language developed by company "SUN micro systems" and created by "James Gosling".

Sun micro systems started by group of students who are studying in standard university.

These people are faced the problem in their room with electronic consumers i.e., one electronic consumable remote control is not worked on another electronic consumable. These people wanted to develop a common remote control (CRC) which is controlling all the electronic consumables. So they contacted James Gosling and requested for the project.

Sun micro systems started by group of students, out of them one person from India whose name is "Vinod Khosla".

James Gosling and his team members given the project name as "GREEN" started in the year 1990 and 1991. CRC completed in 1992 and named as star7.

James Gosling team developed a new language called as "OAK". But this name is already selected by some another company. So it is renamed as "Java".

Following conversation is the process why named it as Java

From: James Gosling 
Date: December 12, 2012 8:16:58 AM 
To: Ashok Kumar 
Subject: How was Java named? 
     Hi Ashok Kumar, The story goes like this: We needed a name. We had been using "oak" (which as selected essentially randomly by me), and while the team had grown attached to it, the trademark lawyers ruled it out. We had lots of email debates about names, but nothing got resolved. We ended up in the awkward position where the #1 thing stopping us from shipping was the name. 

     Our marketing lead knew someone who was a "naming consultant" (I don't remember his name, but he was great). We could neither afford the price nor the time of a conventional product naming process. He agreed to do something rather odd, but effective and quick: he acted as a facilitator at a meeting where about a dozen of us locked ourselves in a room for an afternoon.

     He started asking us questions like "How does this thing make you feel?" (Excited!) "What else makes you feel that way?" (Java!) We ended up with a board covered with essentially random words. 

     Then he put us through a sorting process where we ended up with a ranking of the names. We ended up with a dozen name candidates and sent them off to the lawyers: they worked down the list until they hit one that cleared their search. "Java" was the fourth name on the list.

     The first name on the list was "Silk", which I hated but everyone else liked. My favourite was "Lyric", the third one on the list, but it didn't pass the lawyers test. I don't remember what the other candidate names where.

     So, who named Java? Marketing organized the meeting, the consultant ran it, and a whole pile of us did a lot of yelling out of random words. I'm honestly not real sure who said "Java" first, but I'm pretty sure it was Mark Opperman.

     There certainly wasn't any brilliant marketing mind who went through a coherent thought process. 

Thank you, 

James Gosling

The unofficial abbreviation is "Just Another Virtual Analyse".

Different types of Java versions
Version Name        Code Name         Release Date
------------        ---------         -------------
JDK 1.0             OAK               January 1996
JDK 1.1             ---               February 1997
J2SE 1.2            Play Ground       December 1998
J2SE 1.3            Kestrol           May 2000
J2SE 1.4            Merlin            February 2002
J2SE 5.0            Tiger             Sepetember 2004
Java SE 6           Mustang           December 2006
Java SE 7           Dolphin           July 2011
Java SE 8           ----              March 2014

Java Features
1. Object Oriented
     Any programming language called as object oriented language then that language must be satisfied the following 4 principles.
1. Encapsulation
2. Abstraction
3. Polymorphism
4. Inheritance 
E.g: CPP, Java

The languages that are not supporting inheritance and dynamic Polymorphism are called as "Object based language".
E.g: VB, Java Script

Why C++ is partially OOP?
According to pure OOP principle, no main() method/any method should be exist without the object. In C++, main() method can be independent and doesn't need any class.

C++ provides "Friends" which is absolute corruption to the OOP principle of "Encapsulation".

According to OOP principle, everything needs to be object. C++ provide inbuilt data types int, float etc. Which are not object in their nature. C# and Java also provides some kind of data type, but its inner presentation is always object. For example, in java you have got a wrapper classes. All these are derived from Object.

According to OOP principle, one object should have only one hierarchical parent reference. But in C++, multiple inheritance contradicts its principle. 

In Java any function must be written in inside of the class, with out class program creation is not possible. Such type of languages are called as total OOP. Java supports this principle.

2. Java is multi threading
     Multi threading means more than one action can be done at the same time within a program.

3. Java is platform independent
     If the application compiled code is able to run in different operating systems then that application is said to be platform independent application. The programming language that is used to develop this application is called platform independent programming language. Java is platform independent programming language, because java program compiled code can run in all operating systems.

     A platform is a hardware or software environment in which program runs.

Software Platform
     This is used to convert the program into executable format.
E.g: Java, .Net

Hardware Platform
     This is mainly used to executing the statements with help of processor.
E.g: Operating System

Java programming language comes under software platform. Which consisting 3 portions
1. JDK (Java Development Kit)
2. JRE (Java Runtime Environment)
3. JVM (Java Virtual Machine)

JDK also called as SDK (Standard Developement Kit)

JDK provides environment to develop and run java applications.

JRE provides environment only to run java applications. For example, you installed java application in client machine, then the client is responsible for run java application, not responsible for develop java application. So here JRE is required.

JVM is responsible to run our java application line by line. So here JVM is interpreter. More about JVM refer this JVM Tutorial 

Source Code
Developer written program

It is written according to the programming language syntax

Compiled Code
     Compiler generated code converted from source code

     Converts the source code into machine language at once.

     Converts the source code into machine language but line by line.

Executable Code
     Operating System understandable code (.exe files)

4. Java is portability
     Portability refers to the ability to run a program on different machines. Java byte code (.class file) run at any environment by JVM.

5. Java is robust
     Robust simply means strong. Java uses strong memory management. There are lack of pointers that avoids security problems. There is automatic garbage collector in java. There is exception handling and type checking mechanism in Java. All these points makes java is robust.

     Java programs will occupy same memory on all operating systems that means in windows integer takes 4 bytes, on Linux and Solaris also it will occupies same memory. So that memory management is same hence on one operating system the program is executing, same program will execute on any operating system. That's why java program is reliable.

6. Java is architectural neutral
     A language or technology is said to be architectural neutral which can run in any available processor in the real world. The languages like C, C++ are treated as architectural dependent. The language like Java can run on any of the processor. Irrespective of their architectural and vendor.

Portability = Platform Independent + architectural neutral

7. Java is distributed
     A service is said to be distributed service which runs in multiple servers and that service is accessed by n number of clients across the globe. In order to develop distributed application we must require architecture called trusted network architecture. To develop those applications we require a technology called J2EE.

Next Tutorial  Java Language Fundamentals


  1. This comment has been removed by the author.

  2. Hi Sir,

    is java a pure OOPS language..
    Please help me on this...

    Thank you.


    1. Thanks for visit.. Come to your question.. :) As I discussed this tutorial
      Java is not a pure Object oriented language :)
      For any language to be pure object oriented it must follow these points strictly...
      1) It must have full support for Encapsulation and Abstraction
      2) It must support Inheritance
      3) It must support Polymorphism
      4) All predefined types must be Objects
      5) All user defined types must be Objects

      Now, java supports 1, 2, 3 & 5 but fails to support 4.
      In java we have some predefined types as non-objects (primitive types). Although we have wrapper classes for this primitive types that's why java is not 100 % pure OOP.. It is only 99 % pure OOP.. :p

    2. Hello Ashok,
      Java's primitive datatypes are not objects because they didn't want to compromise on the efficiency of those types. And for objects we do have wrapper classes. It has to do with efficiency only ! :-)

    3. thanks Mushif for pointing out the misleading information .

  3. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.