SlideShare a Scribd company logo
1 of 16
Java Programming
Manish Kumar
(manish87it@gmail.com)
Lecture- 2
Contents
 Java Environment Set up
 Simple Java Program
 Internal details of Java Programs
 JDK, JRE & JVM
Environment Set up
 To set path of java is required when you save source file (i.e., .java file) any where in your system except bin
directories.
 To set environment for java programming you must follow the steps given below:
 Download JDK according to the version of Operating System.
 Run the .exe file and install it.
 You will need to set path to point to correct installation directories.
 To set permanent path for windows:
Suppose you have installed jdk in C:Program Filesjavajdk directories:
 Right Click on Computer and then select Properties
 Click on Advanced tab and then click on Environment Variable button
 Click on new button under user variable/system variable and write variable name as path & variable
value as: ‘C:Program Filesjavajdkbin'
Environment Set up
 To set temporary path for windows:
 Press Window + R button on keyboard and type cmd in run prompt and click ok button (i.e. open
command prompt)
 Copy the path of jdk/bin directories
 Type set path = copied path
For Example:
Set path = ‘C:Program Filesjavajdkbin’
 To set path for Linux:
To set the path of java in Linus is same as windows but in the case of Linux we use the export
tool rather than set. Path in Linux is look like as
export PATH = $PATH:/home/jdk1.6.01/bin/
Simple Java Program
To write a simple Java Program, we must know some basic points like class, object, etc. These are described
briefly as follows:
 Object is a real-world entity and it has state and behavior. An object can also be defined as instance of the
class.
 Class can be called as group of similar type of objects. Class is like a template that describe the
state/behavior of objects.
 Methods: We write logics, data is manipulated and all actions are executed in methods. There can be many
methods in a class.
 Instance Variable: Every object has its unique set of instance variable. Instance variable is declared out side
the methods i.e. at class level.
Simple Java Program
First Java Program:
public class FirstProgram {
public static void main (String args []) {
System.out.println(“First Java Program”)
}
}
Save this file as FirstProgram.java
To compile: javac FirstProgram.java
To Execute: java FirstProgram
Output First Java Program
Simple Java Program
Important Points of Java Program:
 Java is case sensitive i.e. identifier Hello and hello would have different meaning
 First letter of class name of any java program should be written in upper case. If any class name has multiple
words then every inner word’s first letter should be in upper case. (It’s only a convention rule.)
Ex. class FirstProgram
 The methods of java program should start with lower case letter. If methods name has several words then
except first word’s letter all inner word’s first letter should be in upper case.
Ex. public void getData()
 Program file name and class name both should be match.
 Program processing starts from public static void main(String args[]).
Simple Java Program
Parameters used in first Java Program:
 class is a keyword used to declare a class.
 public is an access modifier used for visibility.
 static is a keyword used to make a method as static and the advantage of static method is that there is no need
to create an object to invoke the static method.
 void is the return type and it means it does not return any value.
 main is the starting point of a program and it is name of the method.
 String args[] is used for command line argument. Here String is predefined class and args is array name.
 To print any statement, we use System.out.println(), in which System is a class, out is the reference
variable (i.e. initialized by reference data type) of PrintStream class and println() is the method of
PrintStream class.
Internal details of java programs
 At compile time by java compiler it does not interact with Operating System and converts the java code into
byte code or .class file.
Internal details of java programs
 Following steps are performed at run time:
Internal details of java programs
 Class loader – Subsystem of JVM that is used to load the class file.
 Bytecode Verifier – To check the code for illegal that can violate access right to objects.
 Interpreter – Used to read the bytecode stream and then executes the instructions.
JDK, JRE and JVM
JVM (Java Virtual Machine)
 A virtual machine that provides the run-time environment to execute the java application.
 JVM is platform dependent because the OS configuration are different from each other.
 There are following task performed by JVM:
o Loads the code
o Verifies the code
o Executes the code
o Provides runtime environment
JDK, JRE and JVM
JVM (Java Virtual Machine)
JDK, JRE and JVM
JRE (Java Run-time Environment)
 JRE provides set of software tools to develop java applications. JRE physically exist and contains set of
libraries & other files that JVM uses at runtime.
JDK, JRE and JVM
JDK (Java Development Kit)
 JDK contains all the tools that are required to develop java applications and applets. JDK physically exist.
Lecture - 2 Environment setup & JDK, JRE, JVM

More Related Content

What's hot

Java Development Kit (jdk)
Java Development Kit (jdk)Java Development Kit (jdk)
Java Development Kit (jdk)Jadavsejal
 
White Box Testing
White Box TestingWhite Box Testing
White Box TestingAlisha Roy
 
Java Presentation
Java PresentationJava Presentation
Java Presentationpm2214
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testingSoftheme
 
Presentation on Core java
Presentation on Core javaPresentation on Core java
Presentation on Core javamahir jain
 
Core Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsCore Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsMahika Tutorials
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing FundamentalsChankey Pathak
 
Difference between functional testing and non functional testing
Difference between functional testing and non functional testingDifference between functional testing and non functional testing
Difference between functional testing and non functional testingpooja deshmukh
 
JRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAJRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAMehak Tawakley
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaShravan Sanidhya
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Java Lover
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in JavaNiloy Saha
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)arvind pandey
 
Core Java
Core JavaCore Java
Core JavaNA
 

What's hot (20)

Jdk,jre,jvm
Jdk,jre,jvmJdk,jre,jvm
Jdk,jre,jvm
 
Java Development Kit (jdk)
Java Development Kit (jdk)Java Development Kit (jdk)
Java Development Kit (jdk)
 
Operators in java
Operators in javaOperators in java
Operators in java
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testing
 
Creating your own exception
Creating your own exceptionCreating your own exception
Creating your own exception
 
Presentation on Core java
Presentation on Core javaPresentation on Core java
Presentation on Core java
 
Core Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsCore Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika Tutorials
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
 
Difference between functional testing and non functional testing
Difference between functional testing and non functional testingDifference between functional testing and non functional testing
Difference between functional testing and non functional testing
 
JRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAJRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVA
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan Sanidhya
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Java History
Java HistoryJava History
Java History
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
Core Java
Core JavaCore Java
Core Java
 
Soap UI and postman
Soap UI and postmanSoap UI and postman
Soap UI and postman
 
Core java slides
Core java slidesCore java slides
Core java slides
 

Similar to Lecture - 2 Environment setup & JDK, JRE, JVM

Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java ProgrammingMath-Circle
 
Unit of competency
Unit of competencyUnit of competency
Unit of competencyloidasacueza
 
Java programming basics
Java programming basicsJava programming basics
Java programming basicsHamid Ghorbani
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginersdivaskrgupta007
 
How to run java program without IDE
How to run java program without IDEHow to run java program without IDE
How to run java program without IDEShweta Oza
 
Introduction
IntroductionIntroduction
Introductionrichsoden
 
Unit2 java
Unit2 javaUnit2 java
Unit2 javamrecedu
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for MainframersRich Helton
 
Java-1st.pptx about Java technology before oops
Java-1st.pptx about Java technology before oopsJava-1st.pptx about Java technology before oops
Java-1st.pptx about Java technology before oopsbuvanabala
 
Java programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruJava programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruNithin Kumar,VVCE, Mysuru
 
SMI - Introduction to Java
SMI - Introduction to JavaSMI - Introduction to Java
SMI - Introduction to JavaSMIJava
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh Samarthyam
 

Similar to Lecture - 2 Environment setup & JDK, JRE, JVM (20)

1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
 
JAVA Program Examples
JAVA Program ExamplesJAVA Program Examples
JAVA Program Examples
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
Unit of competency
Unit of competencyUnit of competency
Unit of competency
 
Java programming basics
Java programming basicsJava programming basics
Java programming basics
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
 
How to run java program without IDE
How to run java program without IDEHow to run java program without IDE
How to run java program without IDE
 
Java introduction
Java introductionJava introduction
Java introduction
 
Introduction
IntroductionIntroduction
Introduction
 
Unit2 java
Unit2 javaUnit2 java
Unit2 java
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for Mainframers
 
Java
JavaJava
Java
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 
Java-1st.pptx about Java technology before oops
Java-1st.pptx about Java technology before oopsJava-1st.pptx about Java technology before oops
Java-1st.pptx about Java technology before oops
 
Java platform
Java platformJava platform
Java platform
 
Java programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruJava programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, Mysuru
 
Javalecture 1
Javalecture 1Javalecture 1
Javalecture 1
 
02 basic java programming and operators
02 basic java programming and operators02 basic java programming and operators
02 basic java programming and operators
 
SMI - Introduction to Java
SMI - Introduction to JavaSMI - Introduction to Java
SMI - Introduction to Java
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 

More from manish kumar

Lecture 9 access modifiers and packages
Lecture   9 access modifiers and packagesLecture   9 access modifiers and packages
Lecture 9 access modifiers and packagesmanish kumar
 
Lecture 8 abstract class and interface
Lecture   8 abstract class and interfaceLecture   8 abstract class and interface
Lecture 8 abstract class and interfacemanish kumar
 
Lecture 6 inheritance
Lecture   6 inheritanceLecture   6 inheritance
Lecture 6 inheritancemanish kumar
 
Lecture - 5 Control Statement
Lecture - 5 Control StatementLecture - 5 Control Statement
Lecture - 5 Control Statementmanish kumar
 
Lecture 4_Java Method-constructor_imp_keywords
Lecture   4_Java Method-constructor_imp_keywordsLecture   4_Java Method-constructor_imp_keywords
Lecture 4_Java Method-constructor_imp_keywordsmanish kumar
 
Lecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptLecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptmanish kumar
 
Lecture - 1 introduction to java
Lecture - 1 introduction to javaLecture - 1 introduction to java
Lecture - 1 introduction to javamanish kumar
 

More from manish kumar (8)

Lecture 9 access modifiers and packages
Lecture   9 access modifiers and packagesLecture   9 access modifiers and packages
Lecture 9 access modifiers and packages
 
Lecture 8 abstract class and interface
Lecture   8 abstract class and interfaceLecture   8 abstract class and interface
Lecture 8 abstract class and interface
 
Lecture 7 arrays
Lecture   7 arraysLecture   7 arrays
Lecture 7 arrays
 
Lecture 6 inheritance
Lecture   6 inheritanceLecture   6 inheritance
Lecture 6 inheritance
 
Lecture - 5 Control Statement
Lecture - 5 Control StatementLecture - 5 Control Statement
Lecture - 5 Control Statement
 
Lecture 4_Java Method-constructor_imp_keywords
Lecture   4_Java Method-constructor_imp_keywordsLecture   4_Java Method-constructor_imp_keywords
Lecture 4_Java Method-constructor_imp_keywords
 
Lecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptLecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops concept
 
Lecture - 1 introduction to java
Lecture - 1 introduction to javaLecture - 1 introduction to java
Lecture - 1 introduction to java
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Lecture - 2 Environment setup & JDK, JRE, JVM

  • 2. Contents  Java Environment Set up  Simple Java Program  Internal details of Java Programs  JDK, JRE & JVM
  • 3. Environment Set up  To set path of java is required when you save source file (i.e., .java file) any where in your system except bin directories.  To set environment for java programming you must follow the steps given below:  Download JDK according to the version of Operating System.  Run the .exe file and install it.  You will need to set path to point to correct installation directories.  To set permanent path for windows: Suppose you have installed jdk in C:Program Filesjavajdk directories:  Right Click on Computer and then select Properties  Click on Advanced tab and then click on Environment Variable button  Click on new button under user variable/system variable and write variable name as path & variable value as: ‘C:Program Filesjavajdkbin'
  • 4. Environment Set up  To set temporary path for windows:  Press Window + R button on keyboard and type cmd in run prompt and click ok button (i.e. open command prompt)  Copy the path of jdk/bin directories  Type set path = copied path For Example: Set path = ‘C:Program Filesjavajdkbin’  To set path for Linux: To set the path of java in Linus is same as windows but in the case of Linux we use the export tool rather than set. Path in Linux is look like as export PATH = $PATH:/home/jdk1.6.01/bin/
  • 5. Simple Java Program To write a simple Java Program, we must know some basic points like class, object, etc. These are described briefly as follows:  Object is a real-world entity and it has state and behavior. An object can also be defined as instance of the class.  Class can be called as group of similar type of objects. Class is like a template that describe the state/behavior of objects.  Methods: We write logics, data is manipulated and all actions are executed in methods. There can be many methods in a class.  Instance Variable: Every object has its unique set of instance variable. Instance variable is declared out side the methods i.e. at class level.
  • 6. Simple Java Program First Java Program: public class FirstProgram { public static void main (String args []) { System.out.println(“First Java Program”) } } Save this file as FirstProgram.java To compile: javac FirstProgram.java To Execute: java FirstProgram Output First Java Program
  • 7. Simple Java Program Important Points of Java Program:  Java is case sensitive i.e. identifier Hello and hello would have different meaning  First letter of class name of any java program should be written in upper case. If any class name has multiple words then every inner word’s first letter should be in upper case. (It’s only a convention rule.) Ex. class FirstProgram  The methods of java program should start with lower case letter. If methods name has several words then except first word’s letter all inner word’s first letter should be in upper case. Ex. public void getData()  Program file name and class name both should be match.  Program processing starts from public static void main(String args[]).
  • 8. Simple Java Program Parameters used in first Java Program:  class is a keyword used to declare a class.  public is an access modifier used for visibility.  static is a keyword used to make a method as static and the advantage of static method is that there is no need to create an object to invoke the static method.  void is the return type and it means it does not return any value.  main is the starting point of a program and it is name of the method.  String args[] is used for command line argument. Here String is predefined class and args is array name.  To print any statement, we use System.out.println(), in which System is a class, out is the reference variable (i.e. initialized by reference data type) of PrintStream class and println() is the method of PrintStream class.
  • 9. Internal details of java programs  At compile time by java compiler it does not interact with Operating System and converts the java code into byte code or .class file.
  • 10. Internal details of java programs  Following steps are performed at run time:
  • 11. Internal details of java programs  Class loader – Subsystem of JVM that is used to load the class file.  Bytecode Verifier – To check the code for illegal that can violate access right to objects.  Interpreter – Used to read the bytecode stream and then executes the instructions.
  • 12. JDK, JRE and JVM JVM (Java Virtual Machine)  A virtual machine that provides the run-time environment to execute the java application.  JVM is platform dependent because the OS configuration are different from each other.  There are following task performed by JVM: o Loads the code o Verifies the code o Executes the code o Provides runtime environment
  • 13. JDK, JRE and JVM JVM (Java Virtual Machine)
  • 14. JDK, JRE and JVM JRE (Java Run-time Environment)  JRE provides set of software tools to develop java applications. JRE physically exist and contains set of libraries & other files that JVM uses at runtime.
  • 15. JDK, JRE and JVM JDK (Java Development Kit)  JDK contains all the tools that are required to develop java applications and applets. JDK physically exist.