SlideShare a Scribd company logo
Java Virtual Machine
and
Runtime Environment
Basic Concept
 When you write a program in C++ it is known as
source code.
 The C++ compiler converts this source code into the
machine code of underlying system (e.g. Windows)
 If you want to run that code on Linux you need to
recompile it with a Linux based compiler.
 Due to the difference in compilers, sometimes you
need to modify your code.
The Concept of WORA
 Java introduced WORA: Write Once Run Anywhere
 When you write a java program it is known as the source code of
java.
 The java compiler compiles this source code for a software system
known as JVM
 This compiled code is known as ‘Byte Code’
 We have different JVMs for different systems (such as JVM for
Windows , JVM for Linux etc).
 When we run our program the JVM interprets translates) the
compiled program into the language understood by the underlying
system.
 So we write our code once and the JVM runs it everywhere
according to the underlying system.
introduction to java
Byte Code
 Java programs (Source code) are compiled
into a form called Java bytecodes.
 The Java compiler reads Java language
source (.java) files, translates the source into
Java bytecodes, and places the bytecodes
into class (.class) files.
 The compiler generates one class file for
each class contained in java source file.
Java Virtual Machine
 The central part of java platform is java virtual
machine
 Java bytecode executes by special software known
as a "virtual machine".
 Most programming languages compile source code
directly into machine code, suitable for execution
 The difference with Java is that it uses bytecode - a
special type of machine code.
 The JVM executes Java bytecodes, so Java
bytecodes can be thought of as the machine
language of the JVM.
Java Virtual Machine
Java Runtime Environment(JRE)
 The Java Virtual Machine is a part of a large
system i.e. Java Runtime Environment(JRE).
 Each operating system and CPU architecture
requires different JRE.
 The JRE consists of set of built- in classes,
as well as a JVM.
 Without an available JRE for a given
environment, it is impossible to run Java
software.
Java Runtime Environment
First Java Program
Data Types
 The Java programming language is strongly-typed, which
means that all variables must first be declared before they can
be used.
int gear = 1;
 The eight primitive data types supported by the Java
programming language are:
– int, byte, short, long, float, double, boolean, char
Naming Conventions
 Java uses identifiers to name
– variables
– methods
– classes
– packages
 Syntax rules
– Must begin with a letter (upper- or lower-case)
– May be followed by any number (including 0) of letters and
digits
– The characters $ and _ are considered letters
– Java identifier names are case sensitive
– May not duplicate a Java keyword (e.g. class or main)
Escape Sequence
Control Structures
 Loops: for, while, do while
 If, if else, if else if, switch case
Class and object
 Class is a user defined data type.
 Object is variable of a class
– Data Members and Methods
 Constructor
 Method Overloading
 Inheritance
 Method Overriding

More Related Content

PPTX
Java byte code presentation
PPTX
JAVA BYTE CODE
PPTX
Java virtual machine
PDF
What is-java
PPTX
Java architecture
DOCX
JDK,JRE,JVM
PPTX
Jvm Architecture
Java byte code presentation
JAVA BYTE CODE
Java virtual machine
What is-java
Java architecture
JDK,JRE,JVM
Jvm Architecture

What's hot (20)

PPTX
Jdk,jre,jvm
PPT
Java Virtual Machine
PPTX
Architecture diagram of jvm
PDF
Basic difference between jdk,jre,jvm in advance java course
PPTX
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
PDF
Java Virtual Machine - Internal Architecture
PPT
Java-java virtual machine
PPT
CS Lesson: Introduction to the Java virtual Machine
PPTX
Java byte code & virtual machine
PPTX
Java bytecode and classes
ODP
Java compilation
PPTX
Java virtual machine
PPTX
QSpiders - Memory (JVM architecture)
PPTX
Java Class1
PPTX
QSpiders - Jdk Jvm Jre and Jit
PDF
Introduction to the Java bytecode - So@t - 20130924
PPTX
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Jdk,jre,jvm
Java Virtual Machine
Architecture diagram of jvm
Basic difference between jdk,jre,jvm in advance java course
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine - Internal Architecture
Java-java virtual machine
CS Lesson: Introduction to the Java virtual Machine
Java byte code & virtual machine
Java bytecode and classes
Java compilation
Java virtual machine
QSpiders - Memory (JVM architecture)
Java Class1
QSpiders - Jdk Jvm Jre and Jit
Introduction to the Java bytecode - So@t - 20130924
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Ad

Similar to introduction to java (20)

PPTX
java intro.pptx
PPTX
Lecture java variable , data type, token
PDF
Learning Java: Beginning programming with java for dummies Bach
PPTX
Unit1 JAVA.pptx
PDF
Learning Java: Beginning programming with java for dummies Bach
PPTX
basic core java up to operator
PDF
Learning Java: Beginning programming with java for dummies Bach
PPTX
Java Virtual Machine
PPTX
01_Java_Programming_Lecture-01_FCIT.pptx
PDF
[PDF Download] Learning Java: Beginning programming with java for dummies Bac...
PPT
Object Oriented Programming-JAVA
PDF
What is Java
PPTX
Java Programming Tutorials Basic to Advanced 1
PDF
[PDF Download] Learning Java: Beginning programming with java for dummies Bac...
PPTX
Java introduction
PPTX
JAVA Module 1______________________.pptx
PPTX
1_Introduction to Java.pptx java programming
PDF
Learning Java Beginning programming with java for dummies First Edition John ...
PDF
Lecture java01
PPTX
Introduction to java
java intro.pptx
Lecture java variable , data type, token
Learning Java: Beginning programming with java for dummies Bach
Unit1 JAVA.pptx
Learning Java: Beginning programming with java for dummies Bach
basic core java up to operator
Learning Java: Beginning programming with java for dummies Bach
Java Virtual Machine
01_Java_Programming_Lecture-01_FCIT.pptx
[PDF Download] Learning Java: Beginning programming with java for dummies Bac...
Object Oriented Programming-JAVA
What is Java
Java Programming Tutorials Basic to Advanced 1
[PDF Download] Learning Java: Beginning programming with java for dummies Bac...
Java introduction
JAVA Module 1______________________.pptx
1_Introduction to Java.pptx java programming
Learning Java Beginning programming with java for dummies First Edition John ...
Lecture java01
Introduction to java
Ad

Recently uploaded (20)

PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
master seminar digital applications in india
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Basic Mud Logging Guide for educational purpose
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
VCE English Exam - Section C Student Revision Booklet
master seminar digital applications in india
GDM (1) (1).pptx small presentation for students
Abdominal Access Techniques with Prof. Dr. R K Mishra
Renaissance Architecture: A Journey from Faith to Humanism
PPH.pptx obstetrics and gynecology in nursing
Module 4: Burden of Disease Tutorial Slides S2 2025
Pharmacology of Heart Failure /Pharmacotherapy of CHF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
O7-L3 Supply Chain Operations - ICLT Program
01-Introduction-to-Information-Management.pdf
Complications of Minimal Access Surgery at WLH
O5-L3 Freight Transport Ops (International) V1.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Basic Mud Logging Guide for educational purpose
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Final Presentation General Medicine 03-08-2024.pptx

introduction to java

  • 2. Basic Concept  When you write a program in C++ it is known as source code.  The C++ compiler converts this source code into the machine code of underlying system (e.g. Windows)  If you want to run that code on Linux you need to recompile it with a Linux based compiler.  Due to the difference in compilers, sometimes you need to modify your code.
  • 3. The Concept of WORA  Java introduced WORA: Write Once Run Anywhere  When you write a java program it is known as the source code of java.  The java compiler compiles this source code for a software system known as JVM  This compiled code is known as ‘Byte Code’  We have different JVMs for different systems (such as JVM for Windows , JVM for Linux etc).  When we run our program the JVM interprets translates) the compiled program into the language understood by the underlying system.  So we write our code once and the JVM runs it everywhere according to the underlying system.
  • 5. Byte Code  Java programs (Source code) are compiled into a form called Java bytecodes.  The Java compiler reads Java language source (.java) files, translates the source into Java bytecodes, and places the bytecodes into class (.class) files.  The compiler generates one class file for each class contained in java source file.
  • 6. Java Virtual Machine  The central part of java platform is java virtual machine  Java bytecode executes by special software known as a "virtual machine".  Most programming languages compile source code directly into machine code, suitable for execution  The difference with Java is that it uses bytecode - a special type of machine code.  The JVM executes Java bytecodes, so Java bytecodes can be thought of as the machine language of the JVM.
  • 8. Java Runtime Environment(JRE)  The Java Virtual Machine is a part of a large system i.e. Java Runtime Environment(JRE).  Each operating system and CPU architecture requires different JRE.  The JRE consists of set of built- in classes, as well as a JVM.  Without an available JRE for a given environment, it is impossible to run Java software.
  • 11. Data Types  The Java programming language is strongly-typed, which means that all variables must first be declared before they can be used. int gear = 1;  The eight primitive data types supported by the Java programming language are: – int, byte, short, long, float, double, boolean, char
  • 12. Naming Conventions  Java uses identifiers to name – variables – methods – classes – packages  Syntax rules – Must begin with a letter (upper- or lower-case) – May be followed by any number (including 0) of letters and digits – The characters $ and _ are considered letters – Java identifier names are case sensitive – May not duplicate a Java keyword (e.g. class or main)
  • 14. Control Structures  Loops: for, while, do while  If, if else, if else if, switch case
  • 15. Class and object  Class is a user defined data type.  Object is variable of a class – Data Members and Methods  Constructor  Method Overloading  Inheritance  Method Overriding