mae: Lingores 5 .8'sr0,
(UD (wy O) ey D
SEC: ROLL NO: suB: ots
S.No. Date aa Page "Son! ‘i
jemarks
1) | os|eq}aa Keywords — Dndentitiers and s
| Newanus
DD vr]er Operahyys oO
®» | vejoa | Masneds | Funaions 14 7
© | aaled Tyee of mnetneds) Functions call a3
© | 21 Joa Flow Centre| Statements Be
12 Decision mating Stekmenty Ro
24104 problems ao
axloq_| 73D Looping statements a1
G? | osliea | Nested loop 4
» | oshie Davey s o8
a>] uso Strings as
4) | sre Coops — Syllabus un
$09] 1s)ro Classe, and objed a2
pect
eo
xe
V
i) \
19] elie Stare ond Non-Sterie members az
1 14 Jie Reference Veviable \o3
[ 13D] ae Jr Globar § lelat Vvorable loc
14] 21 J10 Javea Package 19.
s)|_ 2g )ie Access specter n>
ts] arjre Consrguctors tas
mo) aye Types of IniBalization 124 |
ta] Bde Constructor Overtoading ae
sa] gu Constructor local Chalsing 174
re)| alu Muted OVerloadg 133
aD} ain Static amd Non-stake Rlouy 13s
22)! VOT" | Retattow bly ctars ond objew | 177
23) onfu Trhentonce 134Teachers
S.No. Date Titlo Page ml
oe | a) Types of Tnhevirance 141
es se|n Cunsratination & Specialtrovion 43
ae alu This S$ taterenk 128
oF | au Super Sbokement ers
ea | Diemend prbim in Jave a
eesialimenel| Constructor chaining 1s@©
|
: Pra
What is Java
Jove fe a bightuvel Preyreme ng Ingen
wrhien HE fowded by “Dames Gesting and teom 5,
Yeer 2990 ond thy aeltased — official Version
OF Jara Vy the yeor ITT.
Features of — Java
Object Oriented Pegremming Leaguage,
» tay level Preyremening lama wage.
ee Secure Language .
\G weccuse OF 6 Class Fle
Note
sCless Ale is only mead ty JVM) a
;
* plat fore To Arpencent.
glarform OSH Process ve
Suwho te oe oC ipens
TRee gm
W) Mac <— ape aye
Ww) Unax Ipy
JRE —
—
Source Code
bytecode
Tava Runtime
EON) von mank
Convert Bytecode
Roeny Teme’
aadWort flow of Jave
(pidiieenals deme haere
“FJava Development Kil
Add. Tava Fle
|
i
_ \
. vm |
Jove ©
=) de | mmeep | [eve virtua 1
Tava Compiler cae pnachine |
C= loxro] | L_se—"' | |
t Hl i
Net pad i \
Notepad++ | i
L~-~A---- se - eee one
FP Check the Syntax of Vow of code
™ rey ei \ine of Code
PUsyotay raittate
tk . “creche oO Une of Code
row (GRRE?
TE code 74 Hof Underthandable
# cbse ore
ow EET
Weave nT wea?
Gey
poytece? GRANTEE dese
jomichessmerue Cxecun He code
Waite a Java program te pink watteme Message
Demo. Java —> FL Mame
_ RentiGeas
Gat Son ———
> /
{= peer /
(panda Ceraie (Greta) tet Caving £3 ange)
: a BE CED
Class | Mein .
precu [meted 4, System. our. print Le (° welcome”) 5
lous
JPre Jawa Sy Ulebus
——
1D Keywords, Tdanktare ond Vowinhles
7
8) oparaters :
iB) Flow Control Stakements
1) Funetons or Mathods
Vv) mcrBirray soles
> Erp
Vid Stings 7 Aire:pee aac OB terre ae
Keywords
keywords ere those RERHRTITE? merle which ott! pave
PRE pRainay defied tO Ane qraroming Lounguags
> keywords — ghouid — lee be voritten only nn leer cos
Staite void ater.
ees class, public ;
ee
Then one 53 Veayrsorcle om thie
Lest fiers
ee
TdeoiGere ase oe came RNY So yin
program.
> Ldeotifiers ove used te Fen BEY class, Methods |fancten
aod \raniecbles-
ees postin
utes of TreniGers
eee
+) Tdentiters Con be Alphas NuUMment e
ex Dewo123. Tove
152 Shoutad nek hark Wik memes te
ext 123 Demo. Tava
DF and — ove oly 2 Specal Cen cler ee REE Seon be
used with Lao B Gers
ex, Deme.$. Tava, Demo Tava— a
TV) daentinens com Slawr wrth Food =
Sef Dame. Java
ww Single — 1's an Trvatid iden Kore am tha Java
ee), Javo
VID Keywords Com nor be uted as iWdemBfiers
Eni Clase, Javo
Variable ¢
A =! ooemery WEBS wa, 4¢ used to SER
To use a Voniab we have to follow 3 Steps
4) Dectaration ,
it
i) Dnitialization.
TD WBEraKen.@
4) Decloration + ,
ie
" 7 Spach
Te te a Statemeoe wri, Vwrstten bo Spectby
4 yen Morictle
are typeof dae to pe Stered 39 we
Syotex + RRBEEYP Namneme ;
5 Defoutk Yalu
Dara ype Capacity
byt Qo bres or 4 byte A
Short le - bis or by hee ,
1 aa - bres Or bytes 5.
jong ct — bits on a~ toytes
fest oe cae oot
double GR eres or oo oe
1G - brs or bby ies TEN spew
Yeohtan @ obits of me me
qi? Initialization : :
——_——_—
Te je @ Statement Wwlos
a he data Win a Veriable
operator c=).
wae = Blau ;
Synien 3
4s WOMtlag to
uassting “OSS gnmentBry UE zen 4
Tr ts ont oe group of
wiitten to USE alu
Perform the — operation .
Prroq veurn on adding «2 Number
Rad. java
class Add
Statements
qhe Variable
which
+o
oa
ig
Public Stab< Void main (string C3 ongs )
{
I] de ctorasion
jot num t |
Jot vem 25
jot Tes 5
I] Torrrawrasen Spier t
Num 2 = 5 5
gum 2 = te 5
/] UBirafon Sysiex’
res = nem A+ Num D 5
Syntax + dlovety pe
Ver pbent =
Variables 3
Vatue 5
Systm. out, Pre do (* ves*);
Jex \avierble Example. Jaye
clase — Voricdle Example
{
Public Stabe votd mein CString i) orncgs)
{
byte b4 = lo}
Syslem: ou. prtnthe (5403
Short S414 2103
System, oF. printin (84)5
jor Ft = ys084
Systern-ouk. printin (6475
dong LL = cecard;
System. oub. printty CL a> 5
Floor £1 = lose 6 5
Sysken our. priotin Cea);
double di = lonase;
System. our: print (d49 5
Cher ch = tar;
System. our, println Cos? 3
poolean bX = true}
Sys. our pHotso Coed;
String Str = "xyz2@io3" 5
System. our, printdn (str) 5
3
igPe We ne
Ef Chapter -2 Operotons
ir | or
operaray ond
Operator — purlorrnt operations — O70 CPt
of Operators
% Psitymetic opercuors
toe ye).
Pe Trcremest amd Deerement
ye on
# Comparision
<= >=
~* logs cal operators & & NA
% Bstwise operarrs & | A
opercuowns
operetors Wor) qlasenal operators
Write 0 Java Ppreyrom te Calculate Serpe Fo terest i
Analy ss i Depot + double Pp » double t , Guo >
Ourpus —» double gi
Procadume > pm 4% o tere a
Coding t Bi = PR ta T/ioos
Trading 5
Tlo Actual | ultimaie
Codin
3 ole ole
roe +. Si = \s0 2.0 #30190 5
1.0, 2.0, 3.0 ae eres
Si = 0.06Sieppleintrest . Tavs
Fustte clare — Simptetotrest
{
Public Statte Wold mmotn CString Ge ongt)
\
double po = Lo35
dowk t 5 Di0e4
double av = 2.05
dome 25 = pe t¥ Tr /ive 5
Syskem, Our. print le Cad 5
5
wi)
Value of & Newiable by ash
Pre-loerement (tte) posh —inerernewt Catt)
Ancrerscot Bubs tube
Subs tttute pea
operation Pncrennent
Both Pre=Tmerement and fost —Tocrement eperaions hu
Show Seme result TF they ore Uted Without ony
expression or Tora Skahermint:
ee TE A = lo
ate ao
" , "5 sd +0 oo }
® Wmeniver jhe (ntrtenent operator ih Ut Non,
Yoaiatte, Ine Gaicade value of Hoe Choo er ust
Cho With bbe .
Rated) fonda tes Commicpendion) oiaerci will be Sroveg
No he qnen Yverviebly:
* Reolean Voriable Cond be ted yay tnerrenent opera,
Vato ten't be dire cry ved yi nerernen & operator,
Wate program to colaslake nerement
O = leona 0
were say
Wess ath + tth +20 + +40
Tt att oe Hig
res = 62 i
ast
bens
@ a = tees
Te = lot Oty
Fo +tHO + b+ tt + bee 420;
= lot iS IF Flot I + ta.”
= 44 c
@
loon > 12
s
”
tomar
Ot bt lot 26 + Ott + He gEay Pais
5
FT letre plot+ar+io tin 4 4)
+22Decrament operator
GN
+ Th Wl REET the
value of vortable by GmNasiP
Pre -Dewement (= -6') Ep catanenk (e=)
Cah Sub shi bute
se = Operakon
Substs tube eee
operaton
Wak a program te Caleta De me
@ a= lora st
b=20 419
WS - Amst --b + 20 4. —-a;
=e +
y
4
~
Ise oi
belo > 458
meso tenet end yent Hae ake:
Flo AE FID tle td 4 9 420
= 86
lo 2958
re iB
Ot b Hie tar pa-- + --o + bon tH Hb;
= tp tude the stacy lo 42 fae + 18
=)2)s
8 rel x Bs + Ne
vu
c i y aq v
D ZL qe we
~~ x 120
€ ot c U aa
- sy J
= PS nN ae 2 190
7 L | |
4 a q 123
4 mH . ->——
” wa | ay i
T a3 — | as 3 es)cae ®&
: ce ov Valatonat opuveters
Comparision =
a vralues ond
Comparision — open etert LS Compare we
qterns 0 GSBEWER? GEEEGUP -
Comp. Tove
Class comp
\
Pewee Avehe wed min CONOR Te oe)
Vota = toy
INE’ = 204
eoktan fot = A4b3
Syskm. our printde Cot) 5
Syston. our. pdottn Carbd5
Syskm. our, print dy Co <=>);
Systm. our. print ka (ase »;
Syste. out, prorts Caleny:
Systm. out peat da Caz=ny-J
“€®
Lagieat_epecne
ee
= or
Ree ortere oreo ces eae —
: qomaneess os Ot Single Condition,
MoUMpte (BeEWEA?
boolean ves
urn “a
* ogres opevaters wa eswayt ot
apes of Logtcsd Siar
Ann (44)
oe (1)
* Dither t
KP) Vogiccs
Mo Legh cat
» Logi cat Aror (A)
iW
Logica ano (68)
Me
Log cat ann (4&4) OPabrt will yeturn
veth Me Looleom Condit
Veoritem
ae PP TE ee wesutas of
im ath Other Cotes
Tesule de end in
Truth tabu for ;
LE Rate atin
Condstion - 4 Condition = 2logicat. Deve
Class fegicat
\
Poetics static void mein Grin (9 ngs)
\
Wot o = los
Wet b= 205
System. our. Peetts Cone && Lead;
f) Vou 88 Tree —s pecur As Tree 5
System. our, PRatin Coey
Be Leads
N T & @ 5 &:
System. Outs print ty Cassy && brad,
NF ke T se,
System. out, GPrtky Casy ay bea),
1 / € ve For ety
Legis 08 CO) operations
we}
Teter | iN
Poh the! becker Conditions mesure
ound
Smly MH the result of
ond Yq ak 9 thay Costes 3b Terns SRR.C
—
Trew Vale
Condi tien — 4
True
Vrue
False
Fatse
Chats
{
loatces
Porotic Static
\
Into s
int bo
SMS OvF. POE In
Syston. out, pentsn
System. our. protdn (orn
Aue
Syston ouk , Prinstn Coon 14
for Logical
| Condition «
| True
false
Vrrue
False
los
20;
AT
Dy
/)
oa Cy
)
(acy
e
bom)s
7
r
"
ys
Vest
Nave
Vaue
Vreue
Kod go.
void enim (string CD owe’)
— Ts
(eee on pens 5
TVYA4 V9 ‘7vg) Logpead otter CN) 2
@)
4 “A
log et A ogemetor Lo peta GRE 4¢ oma only
TMsult oF Pet
ne
peoleam Conditson’s TESUtE
1s Epo ~ Gee
Tk rete s P
and in al
Other Cates
Truth tele for
Amor (Ca)
Condition — 1 Condit ten -
Resuue
False
Voey cat. Joara,
Hess “Jogicat
Portree Stabe veld main Cetring C2 orgs)
ant oe le}
Nok = 20,
System. our. print ty Coch An brads
Now Rv ose,
System. our, PA bo Cace ny G
0d5
rn
System, oul, PReEL ,
e a Cass 4 beays
h ean F +e,: te
&x Compory oeyseremen
CrQevia Vo __ go & ove
Puc —— bo & obove
degree —— Go | ahener
Close Loar can
{
Pete state void mtn (sete 09 omy
douse tenth = 69.56 5
double Pac = 68.963
douwre clegres = 650985
&
YS. out, Preto Cinth >= 60 by ei
nth >= 60 Puc >= 60 BS dares 5
W (69-56 e= be 8S 68-96 a= 6° && osing > 6,
4 a ——C— Tree 5 trae):
Tt puc
wesuLh
= Sase,
System. our, PRothy Cent oo be
BS Pucrace ay agree >
NW Coare a= 6
8% sase rece &E 65917:
M ( True 66
False && Tre —5 Pre
Foehe a ee
Brtwise Operotor Je} } 2002
—— Se
Bitwise operator will Perform lothuite OPeraKOM! Om avery
Bik ob the Gein value conel Produce TESUrr Os perenne.
Truth tabu foy +
5 wt:
Bere 08 U1) Bikwrse Deo (Ad
CCS
b= 100
alice
alas alfe_—e
af -1 wes 6
ake -4
6 -
ale -0 ees
2-9? af -
'
—»! 1
Il!foot leak, 1)
. 5 “ot xf a a a6
ro av rot vies +i co ga KO ta me hI RO
o+ro+ro FOtSFO +O
> pya
° ° \ ta Gee «Oy 3
\ \ Mya eaee
\ ' 1 ' Wye et
ne s 2 7
7 “ * «= n wl ne
ri par pat nr ae eed teat t er Be +e ee
> 6 + 32+ tr str4arord
> as
4
for o Sb
° o 1 eo oo 1
ae aS xf 3 a
et eM et ee eV te np ere ieee xe Fe oa
> er tae rie tere HOH
wes
7 ery
Bir. Tove
ae
Clos Bit
L
pupue state vera main (string BJ ongs)
joe = TS
jok bb = loos
System - our. print to Ca a5 o
System, out. print tn Catbd; // Its
Syston. our print fo Conds // 129
j
3@&"
Concatenation Operator (+):
aoe
ee
fe is Used ee gem e cunsy EUG WIth omy
eum SBE?
Blo & Sing aed any ef yo“ use cb ope
otoen type
*
i yatue as CFetn
por Ve WU joie the airing aod art
a 9 Sevng:
\ ettowerd” +” werd ear te
> Hatlowortd tie
A
exit
Class Cencatenahon
skate main Void Caring cy orgs)
Pubic
Seing $1 =" 6 3
jot Seay $2 = DS
System. curs prot to (sat oe [foie
Syston. our prota Co nets ¢ "word" “D5 Uf Hetowers 5
System. ove patio Cie "ts" D5 YF ro1s5
Systen our: poets (Tat Fite 5 Hass
Syste. our. pantin wa" 4 ed; I Ade5
System, our. Prot in Caraterd; Il 1985Nyethads
Puterm a
”
ww
wd
Te
Should be Stored oo aw
of
Methods
code in
Syoter ta
Methods [ Fucetions
_
om euee a cas whtth will
Guar assy
are used to Climiincte clupteate Liner of
Ahe PRegrom
cen ee (oneness)
Specter enaiimar tyre
Stmt...
Stmtw
yetwrn 5
Access Spetier i Pulte , Preteded | Tackage-Leva , Peyave
Access modifier; State 5 tom ~ Stove
Retrn pat: Depends en the data type of the Vote
mutnods
aeturnsd rom Tk mathod.
\a]0q} oem
meters omy, value then the gutumned ‘Value
Neale le- enatcning pha retina ype
he meted,
rntthod
whic, 04 calling amother rmethod known oF
ich Fe Called by Smetiey method 78 noun otKo Return ctatement ie Uted to RRR 45. ome CF)
ond SEBMURER from catted = enathed te Catng mathod
then Ue returns
we TE methods do mot return ony, Aiahue
Ayge Showld be Aectawed aa Void
TR retin ctype of method Tf xfetd = then Programmer Con
evip ering Abe eterna Sreternen &
(ES ny tava DEX foro mutmod by Using Verd os ehurn Hype
Public class Add
\
[fuser deGive mated oy Solvton blow
I} radned dectaraton
Publle Stave veld add Gote , inbtb) // 4 (G-e estas)
WY ememod defination
4
Fat vesa ate 5 i/o) (add 20% vo & Shon Fe in wes)
Syston. our. print ba Cres) 5 2-12 Cpvinr vatue of es)
j
I] pre -duemed rmethod | Function
Pulte syute vata lesan Caring CJ anys)
{
System. our. print to Co pryrom sree DS a
add (20, 80) 3 2 (cov tne add memod with Cnt, mt)
Sysiem, ous poorsn CS program ends "D5 [3
J
J
Wher is mein metrod?
rt ts co GEBRNg GPS of Java pF
Ou the @meeenion GREE from here .
wherefe:
(GS) ene ee eer
nr ee
vaing elute type ee ueneen,
WD erample oy a enettind My pany | “ 4)
C\wse Had
\ ' )
Tanite state tnt dd Cinta, int b !
'
Ant were aah th
Syston, oud. prrinktes Cardi If
be has Had
alu ot ns 0a dl
j |
Par stare Ustd renin Cstving LI areqy)
Odd (toy 20d sy catty onettond
J
3
BD tase Add : |
—_—— 7
{
Jubii static tnt Add Coto yet w)
,
joe tes = Oth Sores te nigh ipatine
Tebteny es 5 ff poss dhe oes Uelue 43 tasting pated
Tubtte static void vein (thing £5 anys) :
4 |
i
Syshen. oot print In (BAA C1994 I cating enetnod
j If fod tne ate viet 48 yonssed bey ces tuvees
Malenit anh ytind ohTypes of = Matmods | function Cot VYLO Vp Reus
ae)
ere ore 3 type:
3) chain fimctvon | mmumed cal.
B) Sequence function [ method cath.
WD Recursten Fanton | matned colhs
1D Chats Penction | method col 4
I
| mada 695 routed 107 atime’ 2.49 5
jt my |——>] -__
| _ wouned 205 =
marred 20; KE] Sie
3
Calling method 107; cabled Jo cated by
method 2097
calling muned 205
Qoe method calling’ mother method and tat
method iw catling one more method i8 catiead ag
Chate funcHen — Caitls
Pubic Class funetoncal
Public Stee Votd meethed (1D I) step
\
Syshmn. OuF- protla CY munod 1° D5 Ml step 2
mud 205 [skp +
3
Public Staite Neld method Ca? I skp ©
4
System. out. printin CV maimed 2°25 It skp ¢
3
Pele stee ord
main (Sting C3) ngs)Wwetwad 14
") Fanation frnathod Catt
Pratnied eer |
w) matiod £0)
[main pee
¢ | called
| Snead sess fc>
muted 9.095
: A mained 209
Catting mathod 105 [comniere
OM method 1094 casted by main OD
One erence) 1 - -ealting. neve than
mathod FS called cet Beep uence function | ented cal:
Puble class fUnefon cals
uric StOKE Yeld wnethed 209 // >
{
Systern, outs printtn C" matted wy 44a
J
porte state votd muted 209 [2st
Syste outs PAotln (Smuhod 2°95 // 3.1
y
Putte Shabte Void vrei” string C Jorg):
memod 1095 4
enained 20 5
J
WackPecumsion function | muved
wnethod £075
—
peared a) Ul)
mato
4
&
Mutho a 4005
J
Calting routed 409 cotled by MANOS
ord called by method 1675 esd cclledtng “main 6) 5 t
Qe muthed 3 calling another mathed and that
qrotned calls bark the, forme mated Ts coiled) Ss Recursion
fanction | nated — Cattle @®
Game mined 2 calling Ttsele TE oie cated Pacunsion foncion |
enethod calls
Parte class funestencatll 3
Sq Publre stone stefd method 20%
i
system our protin (8 metned 1°) 5
“the. Some mouthed.
methed 1095 ff calling
3
Pavite
4
reethed 1095
D
stotte votd motn Cstang 0) oye)Chapter
poet Eas
Flow Control Statements
—_——
So
Blow Control Stakeents are used te Gee 4
4
GEE eeu ch preye™ oct the GEMS.
rere aoe 2 types ct | Flow Coobol
Statemeoks.
1D Decision mating Statements
HD Leoptag — Statements .
Note 348 Gees,
Steation How ts hewelled. by Compt end JYM.
oe B MST
y "3 Cantrel Statement Wer can handte jhe Excuute,
Hees
1D Decision = making Statements |
“Trese ore used to €xecuhe Ont oF et ot
Rtarenentt posed on a (Bestey GREE
Eecteao condition | Beoltan -expression t
[captains eee
A comparision Stokmtnt aswitting by wing
colled os
oapese ou -! OF) cum *
cendifon [ Beetkam
co)
a
ef Peasion mating Stakments +
Te
Te -else
ae - else —F
gustteh — cose:oD ie :
Te iF o type of deccion meting shatemneot
ove OT men group oF gtakementt wat within
Baap ctl be exentad TF ond only T— wesult of
condition 18 ame.
Te CRootean Condition)
& Syotert
+ Flow chert 4 Te
we Class Thanarnple
Pubite Skate veld mnedn C8EAng CJ age?
jak class 22;
Th class > 4
mF biece | 4
we | Systenow-printtin CY gave") 3
ody ,
7
y
SS
woh ae
qe ED
beoleanEe = OO eI
®
an
“ Fave prow fe nel Nae gm Hunn
Greater than he
Epub:
Te ie 4s eae hun rretunn — qaetaner ey OOF PY
Yow less Teerample ‘
4
Pubic static veld mein Carving () ort
Mt num = Foj
. true penta tne todo OF elte nok trey
Ie (yum > 40) / te ‘ ‘
»> =¢
{
Ssh Ouse prink In Cron +7 te greater trom 40") 5 I >m
3
— dlses Statements
a type of daettion — rmaking Stakentnt — ushere
of = CRUMBS is executed 3F amd vesush oF boolton
st RB alse the Steternant of oxemeaay 5s arene
Zt (Boots Co0d?)
4
Shnt
Strat
ese
Set
Suntchor! S33.
a Flew
—_—
re
[Reotean Condtion Fats
Se
‘ “Je
eet Chess LFetse @remp le
Pubite statte veld mein (string (1) orgs)
mt num = Go}
Le (num > 40)
&
System ous print tn (% qreater 7 SI) te ek exec ube Te Cote
y elie move to Use body Stme.
ehre
4
shen. 94h primey CY tee "D5
3‘ ven 18 Unt Hn
4 o Tea prey
‘ fron 40
Wt greater nin Ho or (Les
2 "os CUbpee — eben
PTR AN a8 greater sreheen reels Tr,
83 8 cusp
Puvte chars
Thetse exeumpte
t ;
Crum asta) Puride state veld reas chece Cink nven’)
t
Le Cum > 40)
1 ” .
Systm. cur. printin Caum +" is grey thin a0"):
5
else
. .
Systems out. pAotin (nem +" js tas Fhen 40 =
3
5
Porlie Static veld main Cthiny (J ong?)
i
Chee Crum: 415
Chee Coom : 45);
7
: alee
co) TF-else- LE Stotmant me
a
#
Te 3s a type ek decision mating Statement whith
toe ome IER eee og ge
eeeemmy te eee dittrent
Used whenaer
Be ot
Statements,
gyex. TF CMeotten Cond”)
. syor L
Skt
Shot
alse i CRoolean Col”)
Shot
Shot
y
ase
\
Smt
Skt
3
Flow hort
Teoc
ee wo
Tuntic claus sratsei(anemplt
4
Public state void chee Cink oven)
Te (num > 40)
{ "9:
SysourC num 4" is qrester tren ao D3
4
Use 16 Coun 240)
{
Sytour Coum p fe leser then ae" D5
7
Use
Sysour (nom +" ge aquat te 40°);
J
? :
Pubitc State vord main (string C7 orgs) 5
‘ .
chee (4005,
chee C103;
Chee Ces
3
te
r 4ex 21 Compomy Cos turin Op
Jamin i Go amd ahove
poc: Ge and above
degre? Ge and obeve
owl
Pubic clare Company
L
powwe Stale Voted on chee (clouie: Ants, dante pyc, doula bye)
TF Ctenth >= 60 §% por r= 60, $& clegrree p= 60)
{
Sysour (“ ctegivta” ) 5
5
ese
Oe C wer erigiote * De
j
4
Pure skae Wed meaty Gsring 3 ong) ,
{
Chee ( Hn : 5 é
Cmenty pens , ples es | deyree soot D5
j© Gi) a Bale dren. FY
A) Suttch Case Shatter
_——_—_—————
ayer ot — dacision = rnaking Statement
ore cob) say GRAFH
a Tr TS o
whi, Th Weed Whenerer there
to he RRO «hb oxecute ditturenh Sot
of Skalemen Ht.
we Syplex 4 Suite Cenoter)
OM Cate Choice 1 2 Stents 5
bras 5
Case chotce 2: Stes 5
frma 5
heault 7 Skmbs 5
J
ees Puble class Suthehexompi
4
PurwGe state void check (chan open’)
{
Busty Copton)
i .
case "A’ 5 Sysout (“open o 1% sateckal”) ;
break 5
Casepi Sysour Cc option lb ft @alectedD 5
brent 5
e
cotete! > Sysour C* option Sees") 5
brean ;
cose’ d's ayrou C option due pay
:
brea ;deraslk | Sysour C" Favela option "D5
j
5
Pubic Stoo told enain Ceneing 9 oregs)
4
chee Coat) |
eee C2) |
oes ice
j
}
WE Sawa program fy Chee tO Oner YS towed
or oot
ube Clos Sustteh tromple
P '
Pubic Sree void chee Coner epson)
Switch Coption) poa7
casa, Sysour. (“i opton A. ts vous.) 5, branes
cose Et 2) Sysour Co cphon' E vis vous ).1) \rraale 5
cose’ T' 2 Sysour (“ open T 7s vowel) 5 breow 5
case O' 4 Bysour (* wpBeN OTS Nowe" D5 rank 5
cose’ U's Sysour ("ophon LL is Mom") 1 reo;
y ie 3
Core att Rysour C* ophen Oo FS Nowa) 5 brew ;
+ Sysouk (“opon 2 it Wowdl") 5 brent ;
i ysour (“open § tt owe") $ brea;(9)
Care ta!
Cone hats
clefoutt t
j
j
bo Myra (“option o vs
Syeout Caption vo TF
sym (Hao
youre} ")
wavered “ys haa,
vowel "Df Wraete
,
Tubtte grease Mold rein Cabing 09 onge’)
f
chen (N5
Chee CD95
Chea (593
emeew (39 5\
w) Leo Pes grates
Frese ave used te execute ove
greet
ga Javea ert oan
1) Fer leok
x wrile lee
Ww denwhile lee
wy) Fer— Cove +4
Count = 23 for Bee 3 3] Eras p> Tova 9 Count ++
5 | run | Jawe > covek th
cook = 3 4 fer 3473
cover = 4 for Feed fale > Tirminate the loop.
i> puto fom a wo
Values
Pure class number
Puotic state void num (ak 0)
4
for Giant tovnt= 15 Count <= 5 count +49!
Sysour (count) 5
}
jPublic Sabo void
‘4
man Cering 0) ergs) S&S"
num (ottee) // prak att ati ovmben freee Ute to
covet = 2 > t (true Lo a Rt?le
count =U BK le | re
|
I
>t > Count t+
Count = te leenle trun | lo > Count ++
cook 2 1 9 Wee te > Fetse Terminak fe (Code wop.
ee Print aymbers from 9 te a Votes
Public Class Number
4
Pubic Stabe Ved vm (rer 9)
4
for (Covet = Ik Covet = 0
4
tysour Cenvot) 5
j
5 Covet p= 3 Count —-)
5
Pubtic state votd main (sing C7 orgs
nem (ni 10d I psint oll He numbers
J
From 6 to t
5
Treens
Count = I jor= 17 ee jo — > Covat ~~
count =e APTI are q eo wen an
a en ON rue | ae tween
color o (esa = eae re | 1 count ==
Count = No mat | Fatee) 9 Terminate Hu Code:for lvop txornpt
Pubic clare
4
Jublc Save
Ra oe, Git °°
Pe Ge eo o) See ee
i Ceovot "/ 2 == oD
Sysour (" even” + count 25
3
J
3
Punite Stare yotd main (htay CJ ongt >
nem (nt to)
a i
fer odd umber
ie C covet [2 ele 0)Ss
40 While —Leop: Tr is wed whenever Stop Condition
“Oot Ney wu cheined
syovex yore (beckon Condition)
\
Sto t
Stmr
:
from 1 to le
——
ee wrk ao Jove Trey fo Peo Dumber
Pablic class Wwhileerompte Tava
{
Got public stese veld mate (ating CJ oye)
Jor Covet = 25
int N= ley
i 2
whit (covor <= &)
Sysour (Ceove);
Count tty 5
3
j
yi
ert Month a “Exa program to print comb From 1 te 1
Public clase whils example: Tova
t
Punic Srene Void Oem Cnt oD
Sot Cont = 05
white Ci covor >= 1)
4
Syste ow bs printin Ceovnt )}
Count--;o, 1 a
3
Pubvic Stave
{
sue (951995
3
vetd maa Cortes C7 ony)
soe
Eid 1 war a Tave prey So Pemba
zleo,
et | vole | Cle OE
Jubvic Clare While Javea
§
Pusre Sreute Votd check Cink 0)
\
Wt Covot = 4 5
© eka,
wk (covet <= 7) for Seem nor
(comt *f 2 = = 0) —
{
System .ouds print Ln Cove 5
3
Count +43
J
3¢ Ccovot oo
3
Public stake veld main (setng C1) orgs)
4
chee Cnt loo)
:From 0
Publ ctart yolile 2. Jaue
Pubtte Skee Volt Cece Cior 0D
4
wanti—_Ceoen jot Covet = 5
wre Ccoust 7 =
4
36 Ceountt/. 2 == 0D
{
syseur (covet) 5
)
Count -- 5
3
3
Pubte state Volt rmdin Csring CJ ngs)
thea (nt too)
d
5
ko 2 pring C¥en | Nembens,,do— while — Loop +
Te is used whenever WE aretemenh of the
take condiBen Mouy
should be execuked first ond
——————
loop
be kvaluated:
Ryoter © do
4 {
Stent
Stent
}
while (Reotean Condiken) .
GAL Partie dass dowhile
4
Public Stave
\
jot cot = 2
do
t
Sop (cove)
vetd mem chee Cint 9)
Count +4 5
j
while Cent 20)
j
Pubic State veld man (string C7) ongs)
" f
crea (nt 3)
Jred) J
wages
count = Ht pvnt Pg Count HEE Covnte O —y While Condition
covet = 25 print soe EB tee
covet = hh print a! oy mS
4albe
Parentnente Ts
geunt = 32 Yr Wogh Lae eg AT
loop:
Nested loop
—_—$<
Public closs Nested loop Cxample ,
(
Public Static’ Noid prnimsg (int & , int m)
\ 4 8 oe
gor Cink THA God SMe F j+4)
for (ine Bay GE 5 5H
On | aco \ ©
we | WEE] sop (tte ton?
bloae yolocu. j
Sep ( outrleop")
—I
3
pubve static veld mein Cevemng CD ange
4
Pines 9 Cars 7m 3a)
3
j=) ynner Loop
joa ae ho Try OO
a ee
nego 5“ Prmer oop" 9 StF
gee tee * Taeer top" 3+
Ls get
janer loop
toa 223 3 Tru > Enter “Wher loop
as eg Wo te 9" Bene bnog"” St?
et eg Te te SS Dende Weog® th
ey ee 3 tee 9 “ Drmer loop" — jt
5 Y Inner “loop” 9 Tj +t A
. 5 64 > False —o Terminate Inner lwop
raat“ outer loop) —> 1+ '
pot 343 Tre > Er irmer loop
jer ey ote 9S Tver Coop os 5
5 ee PE >“ Loner loop! os 5th
BSG ere 9" Daner! loop) Ss Ste”
“ Imoer leop” 354+
SEA 3 Ftc > Terminal moar loop
— itta
&
Sanne
re 2] end move te naxk Une
prot La 0) 2 pant
Bre S]p amd Stay I Some line
aoa pet
pret
+ ee OF
To pect the pattern ve a
— Flap aa —_ pee OF
class per
t- :
pute State veld visio (ge¥e3 CD orgs)
Sea 3 143 5 144)
fer Cit t= ; p
\
for (HEGEL 3S S44 57544)
\ .
Pr system, ours pnt (Se 2
3
Systm. our pot dn d5°
Sener le
4 424-5 tw. — * — jtt
ge te oe tt
je see te itt
gee ee ee Se tt
pes FE Fee > fermingte te Somer leop.
prin tin ©) > move to vert line oath:
|
ye a tre
sted ee ee" —+ int
pea eae ee ea et
=
jeg —e tea oo tre eae ite
5 False 5 Termine Inner loop
mintind 2 —s meve te Nx Une > 7th
>
A £3 > False —> Taeminate the outer loop.
ieee
— a are
2.3 3.
Public class Pak
Public state veld main Csring TY angs)
4
for Got i= Ved 5 T+4d 123
2 : 223
for Cint 32255435 b44D te?
{
ree proe G5. Pritt (5G
Sy skim. oth Print On C5
33)qe prot Pott bee
@
a2 3
SS re
+ Fd
pamve clas por
{
pusie State verd sein (Stag £3 oFg+)
4
jot Count = 15
fer (int G22 5 TERT Tt+D
fer Got j=2 5 £35 344)
i
System. our. pon E Cr covet 3
3 Count + 5
Sys ken. out. phot sn Os;
334
Fradng
je pm LSD MO tee — Enter Femer love ‘
jel ea eee > Court a coun bt
ger ret ee Count = 2 —> Count t+
jes 338 DHE Count= 32 — > Countth
Rae eet faite = teeminidke “Toner loot
qrinkin (> —? meve te Near line a itt
fea om red te >) Eee “Toner leop
eR tree OO EE —> coonk tt
jrz a ees 7 true 5 Cov = © —> Count th
jez 34? a re Foe be Gy Cont tt
oe ee ee ee eee
Print sn OQ 9 neve de Nek Une a ittCo ey ee amoer Looe N
7 Cover ++
Re Ns eee
ter ted moe Be chenhie) Ft) Co Ge
pea ede ee 5 touat 1 UNE Tt
ee i ee qeeminate Tne, wep
PrhO ss move do RE Ue i++
> kerminer , He Over teop.
yo paar pation like Ae B c 2
a a cae
gq wT
Pubve clase pak
4
pute Stace void main (ariag 09 og)
L
gen cher count = "A'S
forCtor i245 343 344)
System: oh prt ie Coount.) 5
Count +45,
3
Syshin-our, printin (eeTo: AR eHPe. + Porters A FP & a
ee ee }
ce fe
close pak
pawbe Stowe Noid mein (srr9 C1 orgs)
er (therjpstals pee; p++)
. AB
fr Corer petals jee5 a) eS
A&C
4 v
eee;
System, ows print (54
j
Systm. ou prorsn Ce
}
aD
oad
nw
ne ®
apec
Prme HLEMbees Grom
Weyihe «& Tew onvam +o vin
dave yrequam Ae 7"
\ ton.
——~——
ublie cless ane 90
m
4
Pope stati
\ ink Gount © Od |
for (int Ve VG ENS vad)
Void chede printno (int ~)
for Gok Je) 5 3645 jrt)
4b Ceount = = 2)
Systern out print dn C3
3
Count = 0 5
3)
purite State \totd mein (Shing CD orgs) {
' cheek Gri prinkne (m3 F0))
j
Watl a Seva Program to neue the given new
ee eS a pea
Public Clos: primano 13
4
publte Skate Void main Cshiny (9 on gs) 4
ts prime or nok
far count = 0 5
forCink 3= 815 1 SNF pute)
we (ast) 5 sao)
counk +
3
$e Ccom == 22
Syston. oot gto tn Ga 1 + Gs pms nor
t
3
dse |
Sysiem.ow. prink dn (13 ©" ts Mok prme now’)a Tae Pye FP Pee
CL mpeeevaid clots Fete
& aeite grate Verda PHI HS Cor 95, aA
wy azo} int be a5 doy ores
for Ger erg bey T+tD
wes paths
gyptern ous paint Gras):
a=¥3
berms;
3
Povtic stute Vols voain Csigg £1 og s)
Pere (atte 5 ff i.2, 2,559.93, 2, eat cr, 8s
3
Write ao Tava progrmm te chide ght ne Ts pretanty oh tm
Te Fappoaced Sextet ae ee
a
Jublic class Fels
L
public Skate void chee Cink 9, jor x)
A
Jot aos
for Cink ih
System. out. panria
3
os!
be
(x4 is om praus in fab. Sexes")
o
33
Purtic state vord mon (Shing 67 orgs)
h
prt (nites, 221895 ffea3 ts
J
}
frown in fab Sames&
Chapter — 5
Awoays
——$
. & clata — wp
Array is a grap of Somme type alee TN hay
Raed langin and wdex te iden BEY every bicker ona,
Lengthy oa —
lower er
Bend Rend
Prrrey Leeghy = dt
@ Array — Dacteration
Syntax claatype C1] ovrray NorName }
exi int CJ ow,
Syn kext datarype onrvay VorNome C9 5
ext int ovr £3;
@D oo prerey Creates
gyno: arsyVewName = spun datatype (sr)
eh SEY = ae Tore);Aarey Declaration and Creation
cone
syovae i ctetaty pe [J enray\errNowne = ue datatype (s2¢) 5
exs wrt (J ore = Nw sot (io);
e once the Oreyy ts created ath the buckets voill be
lled__ with default Values dkpanding on he claro type
of the orrrey ‘
~ RAM
ext jet [J esr coe wot 05
SESS al ete
He) Lesgty Ts Van’ So burly Nortel whith Contains. she :Count
oF nember cf buuets “10
He Pye arersy.
@ Beway Destiverton ghd Tri Retaab on"
Syntox + clatatype CJ omray Vou Nome = Qa yvayely
evs tat CJ or = hoe te, ngs
firse Indy > © (ouysuroe bound)
Jase Wdey 9 oT: dengty — 1 Copper bound >
enid Yndex > (rer, Length 1) [a (middie bound1 &
ayers cheleration oma nTnthosnehte i
» habe 2 to ae)
s s. = 5
A dee (ke = 0 ee
woe ae |
ey ce) DG ee sere J
vy seing TIS = Geos ee en) aad age}
Prrray _ declerotion amid Creation .
we | Memery allocation
lol 2 °
Ree CeO te wot (39
BD ‘doubue [J b = pao double @ [0-0] 0.0 |, 0:0 | 0.0
er CJ Ce new chee (3)
iv) besten []b ene: becleom (2) out | mus | a)
vd, Shing [JS = nee Shing (3) qe] ou | out
Nott 5
water — | clala [>|
inex > 2 2. 7 oe
eo
ati ye = JS
«PJ — +
oe) = 2
a (uy
OS, eee ©eS
Public chasse Derren Ewomnple
Purtic Brake | Void mam (ering ca) ongs)
4
jt CJ a = Ra es aes a
not dest ods
jot middle dex 7 (o.- engin =i) loo
Systern » Outs pavtin ( hesr toden D5 I) +
Sopha — (midde index); yer
Sop to Ca. tength 3 IS
Boe ty Cao} D3 I +
Sop Bh Cat D3 No
Sop Im (ated 95 14
Sop $n (a 03995 IF
Bop Wn (ae 8
Boe dn (oa ¢s))5 Il Preray Tadey oUt of ounslory
Sop Jn (295 A addressh 7? °tL)
Write Tava page ote pth te guia soy.
pm
Public clase Arvaytk
| . D\
pRaterray (int Tye
Jaden C= crtengty.- 25
Lpuoite sree ver
fer Gat index,
\
System. oul panties (afirdex) ) 3 oe
3
\
Public state Veid main
odes +4)
(sry 09 args)
wm TJ a = hiss, 355 / 2,5.%>
Prtnterray (a5
jor PJ a2 = re frie, %
} Prmerrey (025
Wrike a Jeva Pregyem * pi Ae gee easy Jy Set
pet Se
Pubte clers Srrray ex
f
Public Stake veld printarray Cer f]ad .
4
fer (int jeder = a. Length-d j Index >= 2 J odes --)
\
System our printin (0 Cds 5
]
3
Papi Shute veld mate (Sh8ag CT} ogn)
4
Gales ana p Gece cyan
Trinterrey (0) 3
wv
We CD aD = Ve WWI CTT pag 3
Printersey (ad); 3
LAS SS yeaye @ Teva pregram to sery ome yee eee
a Lt Dey geen eae
yo prot oe onray as ourpul
cass Copy Array
Stare Void Copy (sot CJ e 9
pape
: son & Crectkon
got [UWS = Nu Mt[a, Lergin} 5 | Dedoretion ne
for (jot Tndex = 0 5 index d= avteagts -1 5 inden ++)
wes [inde] = a [der] 5 7
Syste. our paistin (res [index 5
5
3
public State void main (sting td orgs)
4
qt [Jas (t,2, 355
Copy (#95
jot TJ AD = LS to, 2, 3s} 5
Copy (A495
J
Fading, for _Snpur 341.2533
> 2
wes = [ele el |] ercanon.
fe) at (9
iro > o4=2 Wy tree
ses fo) = afeod;
wu fey ota poet Ho fepe ls
joa aero a ote
ws OJ = 409;
ws(tp ar , ier I 2/2] o2 a me ire ?
went} = of
Sea) CES
fey me De me halte 9 fuerntryite the Lop.
For Inpor s HS ,to, 7° as)
be-9——»—0—5,
oy) OU
ori
ico 06 3 —> Ie
aes [To] = 0 (o')
mafe) = So) meet f=[2
fet me 2d me te
mes tid = afd
ms (iJ = lo, say]
| fen aed oe tem
oe ee
mete} ere, tte Y [is] eo] 2 o|
tet 3ST ee re
ny; ves(sD =o (3
wets) = ar, tae ff [5 10
je FET > Folie —> terminate tty loopwrite o SNe pegrem to
fe
=
Fond We Gemenr in He = GY
class find Element
4
puviic Steve void find Cink CD or, jok cement)
\
; cae i
for Cink ‘index = 05 Index <= fang 15 dey ++)
ye (amare == etemene) Jay = £2
i
Syskm our printte Cray [oo
5 :
3
Public Static. Vord mein (sreny 19 orgtt)
L
wok (Ja = hie, 20, 80,755
jor alonent = SO
Find (a, cement) }
3
J
gene a
j=O—> 923 — tHe
3¢Ca [index = = clement)
ae} == 50 ae
Qo = = Fo —s(felser > itt,
fed > 4423 — tre
We (a Cinder
aij == 50
J
"
"
&
i
§
2
U= dlement )
3 (o Cmdr) =O
a(aye= ;
con E> ULE? print Wdey = 2 Ay
yore
My
> 243 — tm
ie Co Godee) == ahernent )
a(zjJ==
Oe ee
T= ~s gag — cetse 5 terrminek Pu loos
r-
weak a Jaye pega ofed mer clement Fem dhe gh
ele or? Pw
errray.
A
puble clase Max Array
{
Public State Void max (int (Jo)
4
yat mex = afeo) 5
for (int index = 0 5 index de a tength I 5 indus ++)
{
e(a[ndu) -> max)
L
mex = & [index) 5
3
3 ;
System. ouk- Paotdn (max) 5
3
publte state veld mein (sting DJ anys)
ees = hr, 4,%, 81,3 eh aye;
max (a) 5 .
j
boeG
queen nox 2 ate) 3 mae er &)
jade =? -” of46 — true
ie Calndex > rox)
Ce Cod > max)
Ge > 2D —» felts oe index tt
index 2 > 2 Se ree
1 Cali] > mexd
be a 2d teu Sl mex = onder)
moe 7 OED
mox = ty dndax tt
jodex = 2 eG SD te
36 (a (2d 2 mex)
(30> 4) Dots 7 mee = yndex’)
mex = 0 (29
mar = 89 5 index tt
Index = 3 Se ee
‘e Ca (sa > rand
(81 > Be) > tres a room = 0 Fedex)
“mee eo (39
mey = 81, Inde FE
wae = OSG
ie (Caled 7 rex )
(Ggeezets es =e Yoder ++
Indu sS 5 os 26 9 HS
te CoC) > mee?
(e789) > fetse ay tndex ++Joder = 6
> oe — to
te Car Cinder’} > 0)
| a1)
(2 ? a1) — Fetse — wodey ++
fodex SH tery qe eiGa =? Fete 5° peneeninete ths loop
Ppriothn (maxd —>
a4:
Waihe a Java program te find mivimem alemenk — From 4
oon ee pe
we ae
publte class Minfrrray
public Static void Mini int £90)
4
jot mio = a [es
for (yt idx = 05 Indew $= an dengh 1 5 Snder +4)
je CaGoaer) © min)
\
3
}
Syston out. print tn (min) :
min = aL[inder) 5
" pubve grate wed “main C8hing £2 orgs)
gor Je = LB, hs PHSB SO Fe
pains (09 5 sor
j :
}_
aerasny
om of SF —> reuse
YW Ca finder) < min)
(afey < 8°)
(ee < ae} — false 9 inden et
et > iets Stotte
we Coed < 8)
(a 2 80> —9 tre mor o fades)!
wie = OT!
wine 4 Sides Hh
inde ST ite
ge Caled < 82)
(24 BD tre eon = & (index):
mins 02)
enia wi oe otndey Hh
index =3 o> eer0 he '
ne (aCad era Caren > fe ay de Hh
dey = se Hee tee
te (aad <2 > (222) 2 fue qmdex +h
Sodex = © sa ses > tee of
ge Co (sd 22D toate welts — Inder +t
Srdty 4S —9 Hse 5 terminate Be loop.
qriet in (min) 2D
ink in = fo) —7 ink min = 8
° ww(on
Wii be
sok Dupticare aly
o Tava pega ro pte Duplicate | ah
Penh
trem tle NER Oraty
Public clase Duplicate
purlie Stae vetd alupt (ot C7 «)
Sev(inr ive, 14 ode tte
oo...
\ .
ye (CoG == 6032)
f .
Syste. our: prin kn (o 659 D>
J
} 3
3
public stake veld main (sting C3 og
wt CJ ea 2 42,%,6,%,71895
alupti (695
420 8 SS TO re
je) a be So Pove
(att) ==0 GI)
(ot ==9 07)
Dat F > fate > 54h
jea 32 $5 7 me
ye Cole == oC)
DRS 6 —s fae peetag EE Oe true
%
os
weCatyy ee eto )
(ofey == ats)
a ee RH me Falta me ed
Ne GO ee
Mt Co fod = ofa)
2S a rt ee print (ofs')) ~99 ata
ser 5 Aru
jes
so) e: aTedD i
a eH RO fodse ma Set
Jee ew ee me batten a Jememiqoke mote loop yi
jet 2D 1 26 mS tree '
i
jer 7m res — He
ve CoO == & G39)
Ve Cap y-== os) ) '
te B= Oo — false oe jth
ee
eC lr 2
Boe ge fe — ott
cs ye te a Cates
fe Catod == eed >
Reed — fobs a ytt
jes as es ee
je Cats) = afsd)
gy ete Se Fale Wo StH
jt 3 6 ES — False > termtnek Panter loop ,
Ceprbens
P+“& Write a Java yregrem_fe Set He TL. Sve, ON
——— a _—— = Sm
Ascending order
Pustte class Sort Arey
Pure Stare veld
{
jot emp =O
goct Cont (IS)
for(imt V0 5 7 <@ acdengin—d 5 pat)
Desendin,
\ io
5 =4 5. ah
for Gant j= i415 Joe a fergte it; /
9 # oft)
sat? eG3)
tere = o IG
aGJ = 4G7>
a3) = temp >
} :
sytem. ou -protin (a [53 5
3
Pubic State veld main Caring 0) ongs)
Ser «fT a = f{w,a,s3
Sort (293
J
}sar tempo gh hel )
— 02 2 —+ Arus
Ve Dep dot a a
& Coli > @ G9)
Co fo) > of)
lo > 1 9 tree 5 ternp 2 oo}
e-fo tunp = lo
of] =a GI ofed= fot} + ofits 1
aj} = tmp — ofS) = le
pratin Cor) — (ae) = 4), 5t4+/) Ter
We oe 0 oe
te Ca CD > a CID)
(a[ed > e179
Ne ee
J=3 eB Ar 9 Gakee erminak Inner loop itt
ied
Vea 9 tre
fe
fo Ge) 2 crea)
-.
lo > 5S > te
temp = © J > tome = lO
ats} =oG) pat) sofa matte s
ats) = temp — Ci) = 10
Tothe (Cali) > (a0D= 5), 3 Il Tiere)Chuplt1—G a
@
Strings
wp sting value Tso qroup of characters whith (TE voritley
yo Aowste_qustt
can access The Chorockers genfoces omy operotions
») we
on tee ShhnS only by using the spathods oF srring.
a Totemally Stmm5 Vales Ys Stovad os 'o chorater PSs by
fae TN
toy s
giting gtr =* atlo” —> \) ie re
oO a 2. 3 +
#) fength CD FTE craturrns tne EGS of Chorachrs sunt
——— me
| jo ame gen Sting:
rretumns ot eammemq ot tre NED
from At given string:
Tt
#D Chore At (index
———
*
ey wales OF Cher) ote matures Pee a a
——
Gherraduc © fromm Ane aver gring:
aretuerns TNE value Ye Pee oe thavacter aon} exist.
pee {et
cD) capvats (suing) 5 ot compere? chovacters OF Yver Wwe
Se
kurns casulh oS
Sings and vel
they ont axackly Borne Ose Tt Teens
false.49 equals Eynore Coss (sting) *
tt comport chavs ert
amd mteros tres ie they
ot given tee Shing
wy anette Case
4 junns fotse
art exactly Same: ater HO —
4) Substring (stort, end =2) ¢
Te crents oO sing from ht YEH Sort
per of Cheractees
tmdlex ue ay
inde ond gvey end a
eters Mee Shing:
neers a oa
al
ge lengte —> Voriable used Ww orevay
\ Length) 2 metro oF gring:
See class StiingExomple Jeua
Pubte State veld mato Ceteng £1 orgs)
*ooey gi =“hetlo" 5
geing St =" HELO",
System, ook Pavel (ST. denghO)¥s MS
Bop (S14. !cherAt Is 4
gop (s4- Wax OF Codsyy
sop Can AMORA IDS Pa
Sep (34. index era, 32>; 3
sop (S23 - aynets (8299 5 I} Fatse
gop C82. caynals Bgrere case Ce) D5 I tro
Sor C $2. Sabshiny (0,35); I] hel- eto Pe ee.
war
ghring Exemple
quer clase
' ee an
pov gratte Void main (srieg TD ongs)
gring 8 = “ \deteome "5
gor Gor, b= Oy 42 S.MengrhO-1 5 er)
4
prot (8. chewht GIs I weteome:
System, our
5
}
3
5 Tove , fe fae! Qn” srainy f
with oO Tay pegs to se ony ng bn,
Reverse
=
public chase StringEvernple
\
vot main Caring C3 as?
puble gSrebe
Sting S = " \Atateome” 5
for (Wnt 1= S.fenginO ~! 5 Cl
4
Sys oe pet (a. cent C993 IPemoclew
5ea .
4@ war a Tave Treyer ot ppt Sesh het oF
the given Shim.
ee
Public class SrvingEvemple
{
Dubie State ved train Cshiny EI orgs)
F
: "
Sting $=" LINGARAT 5
for (int 3 = 0 5 4 <= C8-ferghotd/> > wee)
; F
System oud PANE (s. chev at a);
j
Leng
j
3
wittte o> Jove Yeegyrom = Te print Gest losr elf of the
sa 7
public class SiringExemple
4
purlic Stove void main (stang (1 o-gs)
4
Sting S =" LENGAeAa" ;
| for (int 4 = S.Mengin 6 15 1 o(sefengtnO 112 5H i--)
{
System. ous pint (2-chenAt CD, I TARA
3
J
jGe TON OT Drsceary yo Ceumr He nem ber
w _
crepesting ~ aUMber of res.
— ——~—
wash
—
puvvic ass $tAngErempte
4
quvic
{ ‘
$ x
gring S =) ETN GREAT
Stace wotd Roath Griay LJ) args)
Sot Covnk = 93
for Cint 4
i
je Cs. char At Ci)
{
Count v4) 5
J
3
Syshrn. OOF pron (eovnr) 5
3
jpublic St clase Shing Example
{
| pubic Srase void. rin Csréang £9 args)
| “
Sing $= LIN GARAT 3
for Gint T= 05 14 8. Seng 5 y+h)
{
2 g.dadgh On! 3 34+)
forint jziet a J
4
se (a ert > —
- t
System owt: panthn (8. chert 059) 5
= ghar RE CD@ors
———
(onset Oniented — pTEyTemrotng Syste)
clases and objects
careare OE
Peferencs Noriable
4) (Glevet )-mennber Yorxiable and local Vorierble
y const rectors
wy ais Pe8eegt
wid Pees spear
Relaon lw classes and objet
> Inheritance Crs -ad
#D Alstrad Classes onc Afpstrace methods.
#) Tntertace
* Type Casheg
#> pelymorpi sr
#2 Alesha ction
*) En capsulatoni) Classes ond Objects
4
| Clases ome sw Blue print oF objeck
ay
which has Skee s
Ext
wm) Object TD 4s am
; amd Unique
[feewwne], Spates. Ace Ne , LESE Code, Brome name |
Entity Bomk name, Ace Type y Bal
> Behaviowr 1 withdrawn , deposit
Pen y—> States; colovr , Brand §, looks
LH, Behavior 5 Reed , Write draws
> Skates y hese ame nothing but clata members of dess
a_][_[T[a
Nyse eae netting bur Funeten mernbec) of dens
Addess
Nothing tur Noshcode Value.
Dato members + those
ore Variables which ame caedorid
——
within the — ctass bedy or blow
Funcven members, Those ore Methods | Eunertons shih ot
pe
cleclaved wWillin the clare hod or block