You are on page 1of 13

00000

JeA

Jabeocacktn o dava
Java
aala puoguom shuuckate

Moio Mehod class

Jova cleve lopernnt krl


JDK - JOK Come& AIPlh a Collee hon f tools hot
Mumnfnq dovo pucqom
Cote
enablesdualaging to Java applels
ovac -- Jova Complen Juonslotes bouce ole to byte (ode
Solopueto ,
Javo
Jovop disasemWen, enables to (onvort bjt Code
yele hto a puoquom
°Jovah- puoduce8 heoclex ele
fova doc Gucals rML oumat dbuumonlofon fuom Java
dova
Sooce (ocle
db- Java debuggo . helps b
JVn. Java Vsluol toche
Jova omp lr puolues an SfoamecPote Code
dnown machoe, Ths
byle Code or
Maehne knoon G9 JvM.
Dute IO 01

puetes onpiig Jovo puogom Dlo hyp8A the Sze aod Yaleucs
Code Aheh to VNC that tovedl
byt Javo Java eukual
(omp Ple Machfoe Dala typs
SouNce Code Byt Code
lon-Penlye
(Intuinsie) (Non- Jotu?osc)
Jovo Potorpuelor
Vekal machhe 8 hot mochhe Speckc. The xlon- nUmaric
machme lode he xloman?c Clases

Jovo an

otemedRudo betn the Vefuol mach?oe & Chaxactr Booleon


he gueal machoe
machre
Bytt ocle Java Dac he encouot Shatons hete thexe
olkopulo Cocle. Slete Value ne Vas& ble
o0othetypeype
GorpitiTong he
Compile he Puoguom the Java Comp?lor The proccs onvohg
Vria ble I = Hype) Varia ble 2;
clala ype to anothex
Javac
the Commoncl
the
lbe
name Sotce Callecl
casling
fot m = 50 ;
Javac fle. JavYa byt = (byte)m ;
Javac lompile Gue ats Calleel e. clas
Contanng the byte Code
Codle

Java cmple
Byë (ode
-A-BC Potorpackr
Mochfoe (ocle
MBC (empator
(acb): fs"+("acb
-'tc): ("C
n("6=tb):
;=t
a) Sop"a öplal
15.0F c= F, 0.15 b= Fl50.O =
ngßl) (Shng maîn 6.
Vofd Glelfe poblio ment deoe AasCondeIonal
fandqnment Gement To 5.
)
Relalfonaloporalo dogital 4.
3
Class
opexa
koRelaornal 2. 2.
fos opea Relaonal
uthmec
131.2
F% =
Qb
Expucsion and los poa
6.4E b=
Ouput
t(a*b)) : &op(a
*6 ='+Gum); ("Som
(a-6);("a-b="+ Sop "); ("P- puênth Syskem.
out.
(a+b))
("a+b-'+
; Sop gGloat) +1/ Qum 6om'=
b): "+ ("b= Sop
a); a=+ Sop for
(ab)); =" arb tnputa t.oa
systr Ptt) ;toPs(Y;
6.4F a=d0.5F,
b= jloat
ybt ot
maln Vofl tcSta puble Oum
a$U) (shuog maîn Vo
latc publlc
FloatPot Class
los Opoxo dufhme
fc . Cashng Clas
+ (a== Bc))
Sop ('a== C Rs + (a<C));o
Sop (a!= C)))
Sop("t! = C s " + (b == +b)),dc
Sop ("b== at bs

oulput
b= o. 7S F C= /SOF
a<b teue
a b
a-= C
yalse
tue

b== atb
a+b s ale

3. dogeal opualos
Condelfon% by
used
Combnîog too
, omin mOe
ompoun
celators
a >b X == IO

expusfom
Mclafondt Combheg wo
mHe Lonetons xpusPon tomed
loglal expuegs on

(aqe >55
> $9
Galaxy <loo)
(numbe <0 H homben > l00)
Clas
Java.UPl.
Sonney
fimpot
bubl
else doP
Scanno =
SSop domple
Sop Sal (" te
psal,
age te
("ylot Sop Sal En
>40 = = tx Vo
=
(" Sal S. S.necw
nxFInt Dext the
eltgible Sal
t $ bonug=
bo00 3
bonus Int age
aSconno
():
"+ -utas (0: 0
for Sal) : and 5oo0
sal
bonus')2 Galoy
>
30000)
"); :
Conhuol latments
In emot and Deorem ent opuals SelecIPon
’ lHeta ton
Class Jump
bublc State Vod mafo (Shuingl) avgs) 0 Selecon Sla
Stafement

(est expses Pon)


Sop (" m = "tm):
Sop (h = "tn): Slalement - block ;
Sop (trm = " + trm)
Sop ('n tt = +n tt); Statemernt -x;
(m - " +m)
Sop
Sop ("n = +o)
Clas domple
publfe Stat VoP

oulput m= lO
t - nt, (ount, (ount1, (ount 2;
oat lI Neght =aS0F. 55DF, 46.3F/
loat 1] hight =I10JF , I83 4F , 159.2F/
Count

m
Count 2 = O,

Count 1 = Caunt 1t 1:

Coun t = (ounttt1;

Count 2 = Count - Countl2 ;


Sop("xlumbey posons Ah)
ond hefght >H0
> Pf ((AJ 7,2) = =o)
Sap ( desght y
+Count 1) ; hspit even = even t 1
Sop'othuS ="+ ount 2) :
else
oded = Oclal +1;
ese sBatement Sop Even næ mbeH ='t Even ) ;
Sop ( odd
Syokos
(test expucsion ) Ee Stakment
tuue -blaock Stetement
(est Condikon!)
ele
if (tst ondfon 2)
Falk- block Stete nent
Stekment -1;
Statemnnt -x ele
Sfate ment- 2 :
class Somple
lelse
publc tete vod mafn ( Stufng avgs lU)
t Statcment -3;
Al] -f 1o, IT, 20, 30, 4o}
fnt
Slatment -x;
for (fat f-o; PsA.length it+)
Class xles ing Ese latement
bubl?c Slete Class omple
nt a = 325, b= 2 bobllc alfc Yofl maîn (Shuing angsl)
Syskm.out pafoth ("Laxgest Value %: ");
# (as b) ot sol/lomberlJ = Ill, 222, 333, 444/;
ot mtk J = 43, 30, 81, 75, 58:
la>c) Yet (ot =0; i< ioll Nombex. lengh ; tt)
Syskm, ou t puoth (a) ; (matks ] > 80)
Sop (tollNombey (:] +"Ds on");
else else ! (mayks[] 80 maxks (87 >7o)
oyskm.out. þuntlh (c) ; Sop' rollNombexli] +" FRast cla "):
elge g maxks (:]<to $ maxks liJ >60)
Sop (rollNombe ] Pass") :
else else
Sop (rollNombex ()+"Fapl );

Syskrn, out. pauatia{c) ;


elge
Syskm out þuintn (b) ; Sufkh Shakment
Gafkh (ex pucsfon)
Case Yalue -1
blocK-| *
bueak ;
Case Yalue- 2
block-2
bueak j;

delault
impotJoua.. UH1. dronnet
Stonnot Tealien lelkmeohk
class domple ’ do
rgsI)
pubfe Stote Votd man (shung
ot month Pthrle Stokmens
= ns Sonner (Sysem
fn):
Sionny S month ")
Oyskn.out. uthttn('Enkos the wlhle (tt Condon)
mon th S.next Iht)
Swttc h (month) the loop
Case g

Sop ("Janvaty Clas Bomple


bueak ;
Case 2: pubfe atoht Vod man (Shihgsl) arg5)
Sop ("Fbuatay
bueak ;
While ( fs 10)
Case J2:
Sop (" December") Syskm.out pufotn ():
bucak;
Class

Clas Gample
cass s t
bobl&c Sae Vol moo (Shuhg wp)
68 man (huhg8
Dub So
Shabgbyerl):
do
Chax
Enkr a
Sgenout pasth( anperseat
uhk (Ps t0)
ma
lhfpah

aClas Dowhle Tst CL

Coheh (Ercqpon t)
9t o0, (olumn, ys
Syskm.out.puîsto("MullipRaton Table In );
enkred.."): do
byskm, out palath ( ou hove
Gskm out puloth (Shuiog):
Column =/;
clo

= row * Column ;
do Syslem.out. pahtn (""y):
Column = Colemn +1;
Alhle((olumn <= 3) "):
buoth /'In
Syslem, ouf. double 95
Byskm. Out.puo tln (" to powè -n 0 2lopoon :
KIhle (ow s 3),

Outast
Mulpltoton Table elsc
I2
6
9= l.o/ (dlooble Jp g
6 11/

Slede ment

Body the loop One foH Slakment thin anothu foy


Slaknuot.

Compulfng he pacos 2 Class


nakd. loop
Class est þubl'c tate Votl moin (Shung bogs(I)
Dublc Stoe
Syskm.out þtstio ("the uight ongle huongle
long p Ghown be lo i ln"):
Sop
ol Dat: ps9ipttl

dumpsSokment
ConAhe
Fekon

(las Sonple

Sop()E

Conshue op
1.function. may caler poves
Calculator
cláss
Example: thwhere
e retum
2.
Example: rreetufmerence.where returmThere
Calculator
class inmediatehy execdeutfeidnton
not with The
are STATEMENT
The retu7.rn6
return return; are be returm tmis n
the without public
indicates public value. valurete valurnue; with bwo the exits or isThe The the the
value
method
The The can some types
last withethout used kunction case
cur ently valusespiecignafyture keyword used
with return
integer
value 1/X+yi System. int int m=5;int
valuen=l0;H
a of
as
void.returns
value: mandatory static sum static function data be value: of statement any toreturms
return
for
it
out
that type any o p,
the oftto
=
returns void
This int .println calSum
is can of
thisvalue statements. writreunnning that he as the
insifdeduenctpeinodin ng futnche tion callecrontrol
back a
not to
mandatory the
is for
calSum
integer
assigned (m, main return value or increnel
function andcurtyrpeeon intndilycates swhtaetnemeitnt
this ("Addition n); (String only variable
caller should
one
(int
without
value. match or but executis of reaches
a the ingreturn under
function
for
//
function // args the
x, to expression transferred tr
void is it
any integer []) with is statement
function. retumthe
functions.value. int
the the method type. jump
to + last or
y)/ sum) data tthat
yieldshe section.
Itis
Here prOVl call returned
varlable statement When or
: type function
the de that it
function
functionsic
the
of
execuet,
callerthe
to is heall USed
or
o is
return funcio's eXeate
sum. returns going
insida

is S1gnat
deciarel state Int

LABELED without
In 7.7 statement
if
a LOOPS it Here
labelJava, is
A not
block loop1: to we any public
a provided is the public
of loop, can value.
optional.
displaySum m5:int
blockl: ( displaySum n10;int
exit function;
statements System.out.println >=0)boolean
(sum iffalse:
place give
sum statiC
for byThen statiC
Eunct
lon
a the The is System.
return;
it
label
before programmer
compiler function
the negative") vold
can voidmeans (m,
to statement
be out n);
the a displaySum
signature hain
block is displaySum
labeled
loop wil .println
7/ It 7/
and declared (8trkng
explicitly ; returns
with of below (ThiS return call
as statements. the
shown a function return as ("Additíon function
colon write (irnt scqstI)
void. statement to nothing
below: at A it
statement
returns as So, the %
thelabel
the int that
end. cal
the is t
is without last will ler "+ y)the Decision
Example: any return indicates t
return
statement wil
valid never Sum) Caller.
any without
value.any
be Making
statement
Java value executed nothing
be and
executed.
in
variable tothe Looping
its should
function
caller. cnly
name. 135
This
be
definition
To written
return when
give

You might also like