0% found this document useful (0 votes)
19 views7 pages

Ja 2

Uploaded by

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

Ja 2

Uploaded by

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

Dt : 13/7/2023

faq:

wt is the diff b/w

(i)JDK

(ii)JRE

i
(iii)JVM

thi
(i)JDK:

ipa
=>JDK stands for 'Java Development Kit' and which internally having the

following components:

(a)Java Compiler
Ma
(b)JVM
sh
(c)Java Library
ate

(a)Java Compiler:
nk

=>Java Compiler will check the program constructed according to the rules

of language or not,and converts 'Source Code' into 'Byte Code'.


Ve

(b)JVM:

=>JVM stands for 'Java Virtual Machine' and which is used to execute

'Java Byte Code' and generate result.

faq:
define Virtual Machine?

=>The S/w program which internally having behaviour like machine is known

as Virtual Machine.

(c)Java Library:

i
=>Java Library will provide pre-defined ready constructed programming

thi
components(Java Alphabets) used in application development.

=>while programming we represent JavaLibrary using a word "java".

ipa
=>JavaLibrary is collection of "packages"
Ma
=>Packages are collection of "Classes and Interfaces"

=>Classes and Interfaces are collection of "Variables and Methods"

--------------------------------------------------------------------
sh
(ii)JRE:
ate

=>JRE stands for 'Java Runtime Environment' and which internally having

JVM and JavaLibrary


nk

=>JRE is part of JDK

------------------------------------------------------------------
Ve

(iii)JVM:

=>JVM is internal part of JRE

===================================================================
=====

*imp
Installing Java S/w(JDK) and Setting path:

step-1 : Download JDK from Oracle Website

(JDK17 and above)

i
step-2 : Install JDK

thi
Note:

=>After installation process is Successfull,we can find one folder with

ipa
name "java" in "ProgramFiles" of C-drive

C:\Program Files\Java
Ma
Step-3 : Set JavaPath in "Environment Variables"
sh
ate

RightClick on MyComputer(This PC)->Properties->Advanced System Settings->

Environment Variables,click "New" from System Variables


nk

Variable name : path


Ve

Variable value : C:\Program Files\Java\jdk-17.0.4.1\bin;

step-4 : Click "ok" for three times,then JavaPath is Setted

=================================================================
Dt : 14/7/2023

*imp

Writing,Saving,Compiling and Executing Java Program:

=>In Java Writing program means Constructing "class".

i
define "class"?

thi
=>"class" is a 'Structured Layout' in Java and which generate 'Objects'.

=>"class" is a collection of Variables,Methods,Blocks,Constructors and

ipa
main().
Ma
=>main() is the starting point of program execution and which is having

the following pre-defined standard format:

public static void main(String args[])


sh
=>The following is the structure of "class" in Java:
ate
nk
Ve

class Class_name
{

//variables

//methods

//Blocks

//Constructors

i
//main()

thi
}

ipa
Coding Rule : class_names in Java must be started with UpperClass or Capital

letter.
Ma
------------------------------------------------------------------

Ex-program-1 :
sh
Wap to display the msg as "Welcome to Java"?
ate

class Display
nk

public static void main(String args[])


Ve

System.out.print("Welcome to Java");

------------------------------------------------------
step-1 : Create one folder in any drive of ComputerSystem to save the

programs

D:\Demo148

step-2 : Open notepad and write the program

i
step-3 : Save the program with language extention as follows:

thi
syntax:

Class_name.java

ipa
Ex:

Display.java
Ma
To Save the program,click on File->Save->Browse the folder->name the file->

Save as Type must be "All Files"->Click "save".


sh
ate

Note:

=>Open CommandPrompt and perform "Compilation and Execution Process"


nk

=>To open CommandPrompt,GoTo folder->type "cmd" in AddressBar and press

enter.
Ve

step-4 : Compile the program as follows

syntax:

javac Class_name.java

Ex:
javac Display.java

step-5 : Execute the program as follows

syntax:

java Class_name

i
Ex:

thi
java Display

===================================================================

ipa
==

Ma
sh
ate
nk
Ve

You might also like