Saturday 22 January 2011

Before Coding (Platform Issue)

Why Java is most commonly used by developers ?? why do they prefer to develop using Java ??


The Answer Is .... Because Java Is Platform independent

What Does This mean !!

being a Platform independent means that It works on any Platform any OS (Operating System )

Java runs on windows
Java runs on Linux
Java runs on mobile phones ....etc.

The JVM (Java Virtual Machine ) is the creator of Platform Independency , because the JVM created a virtual machine on your machine regardless the machine architecture .

So Java Can run On any Platform , All what you need is to install the JVM on this platform ..  

Before Coding (Java Program Life Cycle)

We knew Form The articles before the JDK and the diffrence between it and the JRE , also we knew what is a complier and what we will use for writing a Java program

BUT How Does the machine understand the code that i write , We all Know That The machine understand only the machine code (0-OR-1) .. So We have to know How the Code that i write can be understood by the machine

JAVA PROGRAM LIFE CYCLE :

1 - You write Your code in a text editor (Ex. Notepad )  Or in an IDE (Ex. Netbeans) The File Saved From The compiler (IDE) Or the text editor is ".JAVA" (Ex. program.Java)

2- Then when you compile your code the file ".JAVA" is compiled to be ".Class" (Ex. program.Class)

3 - Now you have the ".Class" file Portable which can run On any Platform

4 - The ".Class" file is Interpreted By The JVM  (Java Virtual Machine ) And The JVM turn the Code That You wrote to machine code ..

Java Life Cycle