Wednesday, November 3, 2010

JVM-the Heart of JAVA

JVM-JAVA VIRTUAL MACHINE-(lay man answer)...think differently...yes!!! I can put it this way..
JVM is a set of programs that is assigned with many tasks....then why it is called a virtual machine...we know MACHINE performs many tasks and this is what is done by JVM, since it is a software and all the tasks performed by it are done by programz(that are not seen),it is called virtual machine
As I already said JVM is assigned with many tasks,u might probably think of what tasks they could be???
well!!
  • JVM loads byte code to RAM.
  • Searches and locates the functionality.
  • It converts the functionality into executable code of the correspondig operating system.
  • Allocates memory and loads the executable code of the current functionality.
  • Maintains the executable code in the RAM.
  • Makes processor to execute the current functionality.
  • Deletes the executable code of the function once its execution is complete.
these are the tasks performed by JVM,hence u can call it a virtual machine.

How can we say that JVM is responsible for platform independency????
As we already know that JVM converts bytecode to executable code,only this part of the program is designed according to the operating system compatibility,hence ,therefore u need not change the entire software of java into OS compatible,and we already know JVM is so small in size,easily downloadable,itis not taken into account at all,hence JVM plays a key role in making JAVA Platform Independent.
AND a Key point to remember,it is through JVM we implement the concept of 'Dynamic loading',that is allocating memory to the variables at run-time.
Thus , we can say JVM is the heart of JAVA

Tuesday, November 2, 2010

FEATURES OF JAVA

  • Platform independency
  • Security
  • Multitasking
are the key features of why java has gained its importance in the market..and let me tell u java was exclusively invented to implement  its features on buisness side than on system-side applicationz...so lets have a clear idea on its key features
PLATFORM INDEPENDENCY:
what is a PLATFORM??
Machine + architecture is called  Platform.
The ability of a program to run on any system irrespective of the operating system that is present is called PLATFORM INDEPENDENCY.
C is not platform independent coz the executable code of it cannot run on all operating system. It is confined to operating systems,whereas java runz on an operating system, what makes java program to run on any operating system is JVM, before that lets learn what is source code and executable code????


SOURCE CODE: Any thing which is understandable by the user or programmer is called source code,usually the programz that we write following some syntactic rules is called source code,now this source code can run on any operating system
For example lets take
void main()
{
printf("halo world");
}
this C source code can work on any operating system..(u can check it practically too) then y do we call C as a platform dependent if its source code is running on all operating-systems..well!! here exactly we need to discuss something about Compiled code and executable code.
WHAT IS COMPILED CODE?
Every source code is converted into compiled code in order to make computer understand what the user wants to do,hence compiled code is the binary format which a computer can understand.
Now,in C,compiled code is executable code, this executable code is something which is machine dependent and varies from operating system to operating system,because every operating-system is designed according to its own standards so when u try to run the compiled code of one machine on other machine,definetly u would fail in doing the task coz the machines are not compatible with each other and cant understand each other's code,hence compiled code cannot be run on different systems,hence C is purely platform dependent...
  Now u may have a question of why cant we directly run the source code every time....wats the big deal with compiled code..???
Well! In real time scenario, we can't take risk to give a source code to our clients,the obvious reason is we will run out of buisness in case we do it,hence we always prefer to give compiled code or executable code(in this case) to the clients,hence we need the concept of platform independency i.e the ability of a program to run on any OS(operating system).

Now how java is platform independent??
Java is platform independent because it has the concept of JVM..
before we know what is JVM,lets get into little deep into the concept of compiled code..
Every compiled code need not be executable code,in case of java a compiled code is a byte code,later on this byte code is converted into executable code by JVM.

An obvious question... what is Byte code??
Byte code is also a format which is understandable by computer but it is not in the binary format instead it is in the assembly language format,a combination of alpha numerics and few symbols,(where as binary format is purely 1's and 0's).
So,every java program is firstly converted into byte code and then this byte code is lateron converted to executable code by JVM and is run on machines.
Another obvious question i can expect is when JVM converts byte code into executable code according to machine format,it is obvious that JVM is platform dependent, then how can we say that java is platform independent..
hmm!! It is because JVM is small in size,easily downloadable,fast and hence we do not really take the existence of java into account and hence we run the programz
Remember,JVM is designed compatible to the operating system,hence from OS to OS only JVM varies,thus JVM makes Java Platform independent..


In my next blog we shall see what is JVM,how ever the remaining features of java will be discussed according to the situations we encounter as and when..
I will be happy to see ur comments and doubts in case if u have any

Friday, September 24, 2010

what is JAVA

well any body will say...it as a Object Oriented Programming Language...wen asked to elaborate...????
Language is an expression..it is the means of communication between any two sources...long back when computers were invented...we really needed something to communicate with them,make them understand our requirements and accordingly instruct them to work....this thought of "communication between HUMAN and COMPUTER gave rise to something called as LANGUAGE",thereafter many concepts of how to make computers understand our language came and people started concentrating on invention of language that a machine (COMPUTER) can understand...thats how..PASCAL,FORTRAN,BASIC,B,C,C++ and today JAVA have cum into existence...that cumpletes the story of what is a COMPUTER LANGUAGE
So what is an object???
 One of my pal answered it as "Object is a key to the room"...that sounded good...most of them think the same way....but a small correction..OBJECT itself is a room..technically speaking...object is a physical existence in the memory...what u also call it as an instance...in a nutshell u can say...OBJECT IS AN INSTANCE..I  know u must be thinking INSTANCE of what....let's cum back to this question a bit later..for now just remember OBJECT IS AN INSTANCE..

   It is  becoz of  this Object... java has pertained its Beauty since long ..standing as a unbeatable language all thru years..
 why object...?? well people thought of object only to implement the concept of dynamic memory allocation for the data...
what is DYNAMIC MEMORY ALLOCATION....C is a language that works on the concept of Static Loading- Allocation of memory to the variables during the compilation of the program (compilation is a state of the program where the program is checked for syntax errors if no errors are found it is said to be compiled successfully) is called static loading..
Dynamic Loading- Allocation of memory to the variables at the Run time(run-time is that state of the program where in the program is free from syntactical errors and is in the state of executing the output) is called Dynamic-Loading..and java works pretty well on the concept of Dynamic-loading...


 So, java was purposefully invented to implement the concept of dynamic loading through object...this is what is java its a purely object oriented programming language

J-JUST A-ANOTHER V-VAIN A-ATTEMPT

Yup! u could wonder it was the first letters of each word JUST ANOTHER VAIN ATTEMPT by the founder of SUN MICRO SYSTEMS that gave the name JAVA to OAK...
well!! that was how the name JAVA came...now what makes JAVA so interesting??????
 The concept of OBJECT makes java very interesting..not just Object but its Robustness,Security,Platform Independency , Multi-threading and ability to share the data over the networks thus making the buisness world's work more and more easy...well the above mentioned terms are also called as features of java..which shall be dealt later with cumplete clarity..

Wednesday, August 18, 2010

lets learn why JAVA????

Wat made java cum into existence when C was perfectly contributing to the computer oriented applications?????
Well!! This could have wondered James gosling...wen he probably thot of how to share the data across the networks...Thou C proved to be the powerful language in developing system side applications..there was the need for sumthing else to develop buisness oriented applicationz..(Buisness applicationz means banking applications, custmer related data information etc) there exactly came the need for sumthing which could work on networks and help data trael over networks...in a nutshell one can say that the concept of internet made people think for sum new technology...and it all happened in early 1990's that the birth of oak took place..ofcourse OAK was later reformed into sumthing called JAVA