0% found this document useful (0 votes)
180 views14 pages

Preliminaries of JAVA

Java is an object-oriented programming language that is platform independent, meaning programs written in Java can run on any device with a Java Virtual Machine (JVM). It was created in 1991 at Sun Microsystems and first released in 1996. To execute Java programs, both the Java Development Kit (JDK) and JVM must be installed. When a Java program is compiled, it is converted to platform-independent Java bytecode that can be run on any system with a JVM. The JVM then converts the bytecode into machine code instructions for that specific system. This allows Java programs to "write once, run anywhere."

Uploaded by

Nikini Pabasara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views14 pages

Preliminaries of JAVA

Java is an object-oriented programming language that is platform independent, meaning programs written in Java can run on any device with a Java Virtual Machine (JVM). It was created in 1991 at Sun Microsystems and first released in 1996. To execute Java programs, both the Java Development Kit (JDK) and JVM must be installed. When a Java program is compiled, it is converted to platform-independent Java bytecode that can be run on any system with a JVM. The JVM then converts the bytecode into machine code instructions for that specific system. This allows Java programs to "write once, run anywhere."

Uploaded by

Nikini Pabasara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Preliminaries of JAVA

What is JAVA

 Java is a (pure) Object Oriented general purpose computer programing


language

 Programs written in JAVA can be executed in any Operating System(OS)*

 It is a high level programing language inspired by C Programing language

 Java is one of the most popular computer programming langue still sued by
computer programmers all around the world
History

 Java programing language initiated in 1991 James Gosling, Mike Sheridan, and
Patrick Naughton

 The name “Java” was inspired by the coffee of Indonesian island JAVA

 First public release of Java (Version 1) was introduced by Sun Microsystems


in1996 as a “Write Once Run Anywhere” programing language

 In present day, Java is one of most popular programing language in the world
Role of Operating System and Java

 In high level programing languages Operating System(OS) involves in execution

 This introduces another problem in computer programs that known as


“Platform Dependency”

 Which means, high level computer programs will depends on the OS(platform)
and if the matching OS is not present, program won’t execute

 Currently Java is owned by Oracle Corporation


OS Involvement in How High Level
Programing Languages

Programmer Compiler Operating CPU Output Device


System

3+5=8
 mov   01010
01001
How Java Achieved “Platform Independency”

 By simply introducing another intermediate software system other than the


compiler

 So in-between the compiler and the OS, there is another software system
names “Java Virtual Machine” (JVM) or “Java Runtime Environment” (JRE)

 Therefore, if you need to execute computer programs written in java, you


must have the JVM apart from the OS

 This simple and clever solution made Java “Run Anywhere”


Role of JVM

Java Programmer Java Compiler JVM Operating CPU Output Device


(JDK) System

 3+5=8
 mov   01010
01001




Process of Executing a JAVA program

 To execute a Java program, you need to install both JDK and the JVM as per
the previous slide (Will be discussing at the end of this)

 Use a text editor to write Java program

 Then you can compile(build) your program, in this step your program will
convert in to platform independent “Java Byte Code”

 Now this Byte code can be executed anywhere, where a JVM is present. At
the execution, JVM will convert the Byte code into Machine Codes
How a Java Program is Executed

Machine Code
JDK Java Byte Code JRE

Java program codes

Additional Instructions to the program


Java “Hello World” Program

public class Hello


{
public static void main(String args[])
{
System.out.println(“Hello World!”);
}
}
Practical Session 1
Setting up Java and “Hello World!” program
Thank You…

You might also like