0 ratings0% found this document useful (0 votes) 612 views198 pagesCore Java Handwritten Notes (JSP) Part1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
spider
JAVA
Tyot! Gupta
{
ope aa PPP PPPPPPPPPPPPPPPP PPLE ELLLSooA
Van
wwe
"Tava if a programming Language where Language a medium
whith is need ov Communicahon and pogrom vrefen te oF—
0 f Inshuions -
- program can be an aub mated po luhan for the
manual Work -
. Ga y Parogrom eee jyms an
hb wile a program
app leahon
ir order to develop appl cabin.
Si us necessany
Inorder & perform vassous Lf erert—
Applications aye necessary
tasks
+ Applications on? closified
"efi
Y) web App wcasan
¢. fand Alone App cahion
“Gf on application 3 Wonrted por
out Interne Phen it can be called
in two carey or!go
One Pys lem or rE an
appl tahion woyts with
as Of fad clone Applianon
* Plandedone Apliavion Is also known as Dekkp Apphiaron
&. Nolepad, (akutahy werd,Web Applicahton
“ow ert
nis not Unite fay She stem ov
. 4f an Applicalio
Hy IntenelJt can be called!
Jf an Applicakon works wy
as web Applicahon .
+ lyed Appuicahon consist of three Lay os ‘-
p fronlend
© Backened
) Hatabase
FRonTENO 7h
cua) > This lay
/04/ will help Us ah developp 1%
tser Inberfare Cox) va web
applahen.
“HTML
*¢53
: TJayaseripl”
+ feat D
Backenel '— Ths layer ul helps as alevelopry
«(ove Jav9 che (ee Hes fay a, webappranr -
* Adv Java
+ Frameworks
e g pring
—> Hibernate
atabase ~ 4
D se => They layer will help fs oleveloply
“SOL tommunitatith Vjw applalken
Dapadeue.
& ; Nex, jf 'ptest, Juceboo., ec.
i ei
~- ae ee PPPPPHHPHEARTTTAVAVAAVAVALAAAAGJIVE IIIS III SECC ECEEEC ECCT Ee
cst) cove ev ny Gave Ffondlend Edition
. Java
Cw) Adv } Sead Ear
farhon
(wh) Frameworks
—> Hibernate”
ad gop
: # get of Jnshruchion ap 19 fuman steaclable ferret than st 4g callecl ag
hi A devel (ode.
. if gfe yf Snshucton us in
b4 Mating dod.
Sf get gy Qnshuthon ts postialy Auman eadable ond porhatly
sreadable then te aud af
Linasy jomt i ip eatted ag LO Level lode
Griesimediate Ode.
ep process. re.
mauyne
+ Exewshon fa pe bye 4 0 Fao
= Convers/on jum Aioh nel code % 1atexmeoviate. code
& then
= Conversion pon Gntormediake code machine code.Platform
+ platform isthe combination of’ Froersor and Opeeahig Sslem
Pe. Hardwane and ap tusexe
“of Platform dy necesasy in wide £8 10:0 appbiabon.
+ Tayo ip a -pliform tndepencent Progremniugy Language becouse
jp dees not depercs on Gne paxhiulay flafformand HW
foucrs Worn sevrifeture je. Wsle One Ran Arywne.
flats. sts
Priovessov op (pewiig System [ose vif ;
Arlt vauxle— 19
H/w gw OY PY
Lene
WJORA Asxchfetue
© wll One Ran Pryor
Keywords
“ Keqwords ane basitery a coltecion of Predefined wordy of
SJoeswed words.
* Keqworel ane He urloling Blocks of 2 jove prayram whaye every keyword
ip unipue Ceufferat J.
. Every keyword an be auseol fo puiform Yourous olffeunt Haske
+ Toe ane fw Aeywordy whichian be used! por move phan one
Pk.
29?- PPRPPPRRTERVDD |
LPP TAVDIVAVANA Aaa ecae»
© Note 2 fu beyusords Jn java. must be lows ae.
Cae
& 5 inns YA A Tava Progam
clogs (lassName class clossvome
Class ClassName :
: f pute ghakic void mark
et cghrily orps€D
[dass Members sen :
aaa 1 rial
Lok
math -method =
a J
) han Sow:
> Ot will Aun properly offer gunppighre Rey cords as shown
Class className
: stahie public vot meuh (Shy apleD
[Ltshuvvons
Le
arava Compilahon a ee
Conpilahon | thierprelahon.
jauae fletvarnejava es
nes
high level code.
ia
dass Bike oe
5 se Jotloll ae
Sunter
(tif Bite oss wl as tne]
sie. jou v ype cote [ave4} eee
lahin ’
Source -co#” ad {
favor i
pen Gassame ond
\ Tusp In Time £927)
' conapr) 2
i‘ duo - Step process.
Weiss of Tava propram ye 0 wtp Pi
}) Compilabon
D Soleypretator.
Cornpilation
vertiig Wyk level Code
Lon
+ Compilahion Po process of neve HAE with He Kelp of-
Remredele te: OF Me
an app Yicahen cued as cormprter Gjueel
PPPPOCPPPPPREERIRTATILGATIAAAAAAAAAE"Gre we wile a jove peg
* The java program
Peg bepabietere
yam it has pb be saved tha dehnahon
folder wih Jove fom :
will be checked by tne comply it compley
2 mistake phen we ay a compltohon tx Hor.
i any synta
fan rnstake then jkemediape
H Compiler doe not pias any £4”
lode If growed:
Intexpretahion ie
+ TF as dae process of Conventing
tade +» This can be achieved — using &
machine (IV)
* Intis prove! we might
an Inteumedsede code low level
honslaby Anown as java virtua
get o sunhine evar if Pre cole corvains
logiad midakes.
ony
uss Bike
é
pave stance voll maihl Shirly arps c2)
Syslern ous prin (" He1Bo - ja va") ¥
4 3
Ape: /) bitly 12014, CX
” fp nsfaahon ple”Datatypes
*jove eo Shongly Hyped peogvanmnny Language ive. Whenever we
VSiooe dlada it jp ‘mandalory » poy He pe of diate. exfetalty
by the usetand this tan be achieved with tHe help of olala types.
: Dadelypes aye classified io hud cabegowes .—
D Puimitve Sata type
> None Primbve Data hype.
Primitive data types
+ Primnibive dela fypes ane pre defined olla types anal Hhey ae
ava'lasle in He form of Aeyuoorels
«Thee ane 8 primbve aloda hyper
byte
dhork b Represent Non- Neumel Numbers
int “sw, 0 325084
So
flor to Represen/- Meuimes num bers
doudle 2 2.2244, 00, FW UI H2F
&7,N
xy boolean
moe rue , {ane 4
=
= thaw
» >To Represent 1 Symbol
ES and mush b€ enclosed with single quoles ak 49g 8
'
~
Blin -
ES 3 [Now primive J
ms > “Conechen of Uaravers”
~~
c Grol rast be enuvsed uathvr double queres: Any t
ee with double quel Is a Shity wr
fem ‘A’, “yr eo "Javo - to: 30"
=
=
=. Data pe Range
ps byte _/28 b (24 eee
= shot = 32968 by 3297 ag uit 2uyle
iar any 48 364th 214 PHB INT gph Bre
=
my lors es al jue = Sbyre.
92233 7 2036854 gos gor
fog clout gE -324 194 769313 4 8S 203 gy ark = PgR
Ce var rye ? FP YOLILI5E 38 Dat 2 rye
fae ool frat, fee bir
a
d, symbo! ig bit 2 2tyhe.Cas Shen
i
pubic stah'e void mash Shug ays lI)
@
Ship name = “ yon":
iy age = 22)
double perentare = "9q.499")
dong Patlurbon = " 99999 299997 3
Pro in( name);
fo bln age yy
- 0. bln (penenteged:
os: opin [Phitamier J
3
3
Additon P steqvan: —
pbc Loe Test
v
fabu'e slahre vetl ed Shig aags ED)
¢ jab 1? 302,
ghee By
jd sum 2 ats’,
Lo. bln CI IS
j P
oFS ) Calutate Square Of a Numsey [ven]
XN
> D Glut Area of Orde (mJ
3 Calustate thea of Mlongle £4 64]
SY Glusate Cube of 4 Numbeylv nen]
SD Catulate thy hel Pouentaye for the given subjee
physic, Ubenaishy , Mats, ophiors.
E D Pousve of @ Mumben ? —
spusu'e lass gquare
7
cS t pubu'e stable yard rcun Cthy ayslJ)
me NES,
\ . he
te = ues ene" 89):
Bys tnw ou prsin Cisquene ofa Nw an 9
s)
D Beno Yee’
~ K~
pu'c das preal
psue otable vert pap (Srribg ayslI)
¢ wht red
dowdle pi Sao Ye
= pp eYKTD
3 Systera- Oud): print (1 fread cides 4a a)s
SSSSSSS ee errrrr se!
(we
=
Be
SS
SS9) Ales o
&
3
W tute
pupur
fa sianglt
pubic cass freaT
pblic shat vol wesin (Shop apt
pubie stab yor! man (hatg ops)
Int b> 5;
int fh 23e
bees
doublleaz OF KFS
Systera-ousdpyird in ("fre 4 Arianght="F 4 ); :
cass ube
J NPEL ‘
re CE NEN,
pple oud priltla( 4 tbe fo Murateh= cd
SSSSR EEECCELEEELELEEITTIII AG a
> Pertenteyt vee
pubue class porcartoye
Co
4 publ'c stabe vod pain (Shrity ogs 2)
intp
dous!? 2 > 689,
double C2 54S
clousle M* 93e,
bj o Bw,
‘ : cae (Cpt ct bare
Syste oud fbn (“peacendege oF pal
\s
Xs
NXiteny “Masalg Dosa,
pice S05
§r Dlor.
\
'
|
|
bh) +9
public class gs
é i mess COPE ays
peblic gabe vol
t
+ puasela Dosa")
Shy ifenns
ve 2 BS00Uf
ay puiee
y : / S a (pte it) Hod
flowy
fiorl— It > prea pes
Gpleen och prt (1 plea = "4 Hera);
Systear out pride C poet 2 “4 pnedys
Systennoes prthy( "9882 ¢ 995
sy sree oo Porth" bho apr;
LORETTA) fui fd “apple ae
Output = 4
Prieherky 269) i
1 dn shris \ cur
prvee > >9 : | e a
‘ news |
eee Y a |
ice 29 c |
piee®. port.
pulic 98 pute |
po vis won srg gee |
ee |
flost pricelonky? 2907 |
flo giyia bras 8
Plot pre ® C250 0f/ 1000 07) * Inlay
eB 7
pio hil pore? 2 gat 4g |
Scopin [7 frok * pute
Loo-pol* pre poky * ap hieforts);
pers 2 Vg ty Dmrsd
Sophl” put ®
soph ( "as7 > tg?
en
Soph (* Tor! poze > % bal pried
yie)-® P, 2 $99,pr= 294 ple9, 742499
hg >9 \
di'stounr = 25% B
Py
Rit ¢ | pal
) disounP
\ bill
pucu'e alos disvont”
¢ puoue geabic yoid maihesuy aysl£D)
3299, PRA, PIPL
e Pop) 259%,
pb dyed =P PRPS TP
Plo obbtount = OFS
Plosk dscountvalue Cyolat # abscows) Loe:
Float prJt> dtabiclisioue,
So pln" P, 2 wyepls
go pil pa Muprd5
Sopel ° PB > 73),
Soprl py 2 Me prds
S:oplef" to ad lay = PEMCE- LhaAb',
Soph [? Distpunt-2 "+ Mout mo),
S0pA(> olrowsel value 2 Le- ‘ch ouny vote
Soph /* dl tat af Aitburt BL ydalZ),
TECCCEEC ELEY
"7TUNES USSU irre sey es esi
ee ee rm aa, eae Se
® empttame + fabul | oupus:- emphame
tom > wipro ' Company
on ce Salohy
oo 4 t Qn ans
anaustonus? 57 | fhtlard falar
prbic dass galary
é public stake vor! nasnlSagy Af cD)
f Shy earpelne € Vo! ws
Shyny compiey 2 Musi”)
float salory 29SG00-0f 7
[lot annvslisonus > Cely +15) Moo;
floot Horde lary 2 salary t 0 MMU BOMS,
2", ei
Sopa enpleger Mame seroplrat)}
So pl” lompany * 4 comping);
oO pin [7 Salerg 2 Bse “psalergds
Soplal oBynual Bonug> bs. 7Parnusfhorus) 5
Sapln[? In Heard Saberg = Bs Pafarlialary)
g
yUpdating A Vaniable
) Deposit
balance = $0000 #
Qmounk © 23500
pub lic class Deposit
public sfabie void manlShrrp oxps£ J)
int hilante =5 0000
int amount = 23800
Pysiervout prnttn (* Palance tone olepost? oe
halanwe JF
balance > balance t wows,
QBysrem out prirdtln(? baloloree after deposit ?
dalanre):,
PPPOLLOLOCCCAATAAAAIAAALAAAABOLUS ESOCSE SES SS
> Patan
pubic class dalany
Upaahon
publit sate void marh(Sbung ovgs C9)
é
Iny ¢ Name 2“ Jgoh
oo y
Sy company 2 wipro”,
ae i 25800)
{et bonus > satay 0’ Z
Byshern- out pri » Employee Name = spempName),
piypetercoat Pe as lompary oe company),
qua prt l: & <7 eS .
Upper -o04 ? eee abany);
Sislern-ou > 4 torus)’,
gale cs galary ¢ bonus),
aysren oud poeta [” folat Salary m eselaty) 5
prin [> bovuske 4 ¥
PwaP be witraw:
Puble cls withalraw
t pubue sheabe vod ross (Ship BLD
2 Int amount = 50000 4
TE withdraw 2 12000')
Sysrern out: brit C" Bakeanteer "+ amourt)*,
henry out prittin Cy ttrrdow anourt = a pw) pebred)
amount = @mount ~ to /frelraw ',
Sysrern out pod in( bohnce fpr withdrew 2% Amour);
: j
Y WAP for Product updason price of Pr discount
ubliic class Product
publ't stake voit nein lig aigs LD
a
bt p25 90, pe = B64 pz> Ro, PY * 856",
Int Astounk= es
jhd Poel = py t fe Og Fas pfoo)
?
dlorf ds toyd—arvours bol ;
Sysrerwoubpri-d/o 2 tp)
Syshery oud part/n (*fBr~ WdBIS
Sysheemoud prrtlr(“ Lp 2 the);
Septem Oud prt py = Hp:
Syshemaed porn" Tapal arround = "+ poll)
bade fake CO
(i, © tptal — dBLound amour»
System outprntin(" Tatel arraned of 4 ot
euch e Hoke?
VASAAAAAAS
oT
PIOOCCOCOLOELAIAAVAVINVIAAYCondibiral Slalernents oo
vourte & se of wshueven Sased on
por coraoral Sasement=
duhen we went h @
gome condihton Fen ue 9
Pinple If
efimple if ip basicoluy
ued (01 aching one canolihon.
Ary shruchion sono error byforala for ond 20-7" a
P will aleppeitely eveute buf Tho nabruchon eho cajui Be |
. th iy) exeuwte 0 yo fe condita
sirup if concuipion wil ny Wf .
SGN AG
i can fake only pooloan vellres .
simple If
tastruch'on Jefore
if (boolean cordiih'enn)
|fsboferort.
3
Psion after
BSUSESESrerreceersek ae
Comparision operoins — Logics Operatns,'—
= 448
Lt
!
y
NV AV
vou
Arithmane Operahys.’—
y e+ -—
be se Oot ery
juste class pemo2.
pubute shhic vole! prot Srp asl)
C
KI ose ® (3;
Syshermrout payed in [0 Seafds
jf lage >> 13)
iG Systern ob -forpatin [Eligible py wey”)
3
Syshern,aut poral C% Er Ds
PIPOOLLOP ERE EREATAVVIIIVIVANANAAANSoss
aaa EEEEEEEEE ECE EEEETTEGTS
- lone fo witierclawr with Cordier, ,
public class witrelran
pusuic sabe void mos CSring o4gs LY)
jad balan e 2 6000}
jt qmounts 44000)
Syshern- sets print C+ gatance before byitd raw>
golanc?)',
ive bestest -amoud)
balance 2 ise -amounty
3
fans aur porrnl folance offer witha ©
+ balan ce),
SWasco
oe uf i—
Tee Crean ' flavo uy one es
{ laveur code 1 yarstia 2 1L109) is bok
filevour | urter-Suara ari 36] | res
pares [bmg air | day rusts ae
‘topiy> boolean doping? lof- _
dry frui bso boolean | a «/
pubue class Jiecream
pusise sabe youll prouh (Ship aps)
c
fat flavourlode ees
ifOF float price = ade
bookan /oplop = Fre!
= huey
boolean diy-fo! E
if lmountde 22 )
12
why?
8 stem out portin G ce cor
puce > 100°0f—-
=e
ae
ae
et
—P
ae
=P
=
If (flovourlocle 2 22)
é gysternouk frngie™ Te ecyeans 2% bute Zor))
price > 138-0f;
iF Choppy)
‘\ pie 2 pete f Joy
Pe
23
if (f lavantode 2
£ Sysrernous path (i
pre 21SO°Of
Serereann 2 DIOGO” Oe
ey
if Corry?
pice pie flop
>
if Coy fils)
pie 2 pee £200
5 ce aC prire ® Sos) jie)
ce= pl oe
ue ee Co lost of. Teacvam = + pay
ys nOy ane hme © 2202
on ete up? Uas$
0 class, Lunh Sreak ; 4 ae
dime 2 10.30 as
> Java us
ame > 2-307
2 Soe class
public Class fine
é pusue coke yok moh (Sry ops CY
double Ame 2 12:30
srry ange rads
If Chme 22 lo20)
Clash 2" Javier ats
Dp Cringe 2 !30)
Clase 2 Sg qe-Carss
Sysbemn-o us pri ustn( Time “ype:
tern oes priv 4 Usse 2% :
eee nl age 2 ‘tt class)’XN
EESSSEE PORE PPR ETT eee e ee
Dd int day = 17
put class weele
pubic ghene vor maif Cok aps 2)
£
[weekend & weekday)
Mp oloy 27
" O
if Colay > =1)
S phenol prodin Ga
if Coltey >= 2d we
Sys fern. ore pres C1 weetday yy
(doy > = 3)
Cee pots (4 weekolay y
ip (clay 224)
syshem oud pois » weekday”),
if (day >> x)
syshern Out ryote (
if Colay > > co)
Sypbern-out prvdinl* week day")
if (day 224)
eq shannou pur ( “neck ena)
ifay >?
lepritt 09 Touetsf Doped") +
Peed vel dTnpsd
aiprenn hd PrHdINC” Iyauid Jepad)
Sereler weekerd");
Mn weeb olay yeNoble’ = inen there are muthple if rt 1 passible te
mlekge them ether using Aulepoater , Or operrry
Or operatoy 1's bositouy sued fo mowgo muthple if
lohen the Vhetemenfs ave sant.
pric class bay
publr'e stare vot marr omy ayslI)
v
ink clay = 2}
ipldoy <1 Il olay >
aud: prt inl” dn
Syke: vols dope)
if (oly == I Uf deg BD
ern oud: PT L7 weekend")
sys
pa olay 22 STS”
if (ato
syshenvout ‘py Wey
+
ce =
:
=
N
ay pang 225 hyn
(Lrwerheley es9g You need print the Number of day,
Mom 3- | -td
Te 09/r4 t
1, 3, 5 978) J, 12 93)
H 46, 1,11.930
ce dass day
public stable voi'd math Csinkg es cl)
t
yr Morty =< }
If C more 222) ; i
Gorn our pnl 2epa day" oe
jp loon 2> | I] month> = 11 mmanA = EE monn
pawns 12 Urnen ee
Sjgtera. oud: privd hn 07 3) days"
Lf Coaomtr sorts enh o> 41! mon
pork > 2!
on epmonte2 1"
Syshara ou pribdn pr 30 days)
month é )
n> [2 Jl
$f ( mor ! ed pepe);
Rk Sigpemn 01) puny
YS
SESE UCC UC OOUR COR CES CCCOPPPrrrr ys)® Subjerd ;
ep, 1,0
1 tb ait Gsubjers 2 23-
irany one sub € 37
donh toluslese porenveye
prise foul
do itox if-else]
pubic Cass py
Pk
pubule slebie vot mosh LSP ays lI)
254, 62 sh Mote o> 74 jhhl20)
sole ph ra 251) mess jlo < 20)
Syshem oe: pri In (fait we
nk &
an
fokl = Pt tl +0)
tg per 2 total + /00) /400”
Sysrem- out: pobdln( pes erdye > ate pa);
3
preereetee ft\ af else ‘-
\ So ’
fe muthple sf (duo simp
> uhen we 4
Ne yhathis simanio we Aave hwo seh a joohucbons — bud cithong.
. them will enewle
N 2 def shill we we wrihig tuo conctibons
avord them with the help of if ele,
Jy exeuje meset of ps pry hon our
WE Can
Ss arian
SS? here ip possiele
s
e condison.
Avo jar wri'bhy 20
RSs Wwhenthe cordrhen Y me If part will eng tue
aren london jane ele park wll eacad~,
BS gnarl
» aa > if -ele
psbruritn befor
if (eoretd hry)
E ie *
Dl mghuch ors
d
3
ue
¢
ae
Nyjrshu hors
3
srs hruran offer -
SUSI IIIIII LEEPUbUC clans dD :
£ ey.
ube stare vor moys (arp LI args)
Jb balance 2 £0000)
It mount > 2 faa"
Dus thdvaw
So ply (1 Baton co before witherow
$d pln[* Amount =” ¢omount YY
4 thalonse ay
| f- Comoun$ Chabnt€)
é
bolance 2 belant?- amount }
Sropin (kolance Ure wi Reba > thelense);
J
else
-
Sio plol? Truffiteni- eneunt J;VIII TTIITIITI III
TUUUTTS
Neste IF
0.
Whenever, cael”fasurle. con di
Nesled Tf,
Pgnhe-
hskuchons before
if Ctonctit'on)
é rf Corel ren )
UL ptshrabions
2
g
shshrucyans offey
D> prshrado bY
if Ceorer'hren)
pf (rormirion)
I pshuch
ialeses 3%
ton itide condifion Oe wil go for
inghruanons, YO
iplirsi')
© ip tame)
Mtg hurry
4
Ae
é
prshuies
3
mshu yong after
fe fume decease Troe
3 hh ud tn Yr
7 (rordi Hour)
[ flcorel H%)
Wrshudtrs
be
HY Carel tie)
Mstad 8
meu vin aq.Wthdy ow
laa
Phe 1234
| balenge vSdo0e
amounk *2f000
AANA
pubwr cass (withdraw
¢
pubu'e slesle vole mash CShnty ape D
t
rd pin 2 12345
fr balance 260000, Wout 25900 ©
if (pih pe llr2)
jp Chalance 2amound)
iG
botante > balone~ agnourk’,
. 5
shermo ud printin( belorncoayper vol Pedrow =
Sy f a oS
COOPER LIVY
we
a Syghery oul pntin {7 Posi pf deat Letonee”)
»
sysrem oud ores C8 Tanne peo
“he
PPLLLLELLELERROR eee eee ee ee
q: deposi
Bo 1200
imit= 100000
ph = 1284 dimit
Scone balame » S000
Pancand | eneunhs /aseco
Pancord * twl/false
pubue clase tutherarsDepos!
t
ipl pusic shahte yor rmnoph CSHNg aysca)
It pik PN2Z)
ink amour = 25000
pt balane > So000)
boolean panord> hues
if (pin > = 22)
jf Camoontp bakanie >looo oy)
if Cponbod 22 hue)
é
balance 2b elance + amo unk
Syshermont prrsin( * balancenpger olepos Fase 0)
ols
90 pla nkyed ly Ubk your pancerd');
sit
4
3
ole
balance 2 balance amount 5
Sropin (nhalance fr aipos't 2"t¢balonced
We
: 1 Sof, Ct foorred (7tnt
2 Range progam without operon’
b, & ™,0
? Caluslate porentage
pem> fail
0 30 UST -D Second Uass
P be 029 > firshetass
p mut hap 99 »Distinkon
public class per
d
public stahe void mah (Shing asl J
: yar p2 , EF, me 93, 07 19
int total * P +CfmtD
double pel® plat # 100-0) [4000
if pa 2)
MT pmoor patel Fas") 7
ipel
if C per 9)
pred
é Sysheen out proud in
me
F
mo
os
maw
pe word Uass ">
LILO OCOCCEPPRRRTTIVIIVAAAANSSif (pers? ( 4
¢
If pe 2274)
Srorplr (rfse dors"
us
¢
sorpla (én priehnutou “J,
ACTee Beim,o
dohen ay 4 Sub grenres than 34 solute peilertage
Ha 2 puldgpeil| abo spru%y
Laken Guy one Sid Jeasthan BS 2 pr fu, oe get
Morr! we Nester If rot || operas’
pubtic ass pr
: pusl'c stable vosed magh (amy aped
; .
M+ pr 15 e 2 bb, m264, oneL:
Ne hjel 2 0;
doule per +00;
if (p23)
TPC o> > 3s)
if Cm 28D)
é i (o> =36)
t forte pactat 0
pa 2 Gofal loo) /aoo-w
3
3
g
i y)
Up S24
’ Fe sg pon phastea) =
id Cpe 34) :
i rs o-pln (+ Caarnsdhy
M4 C pes
LORIN Cr YTS D's
' A
F039 Or gp hme;
APPPPLELELCELELLALDIVDIAVIASAVASNAAAYpustrc Class po
é ik
pubUe state void mark (Sri op2lJ)
;
me p ras, c263, mrss, 0718
if (preg 3% c> 5HBR mm293 42 O° 9)
Q
Ir btal 2 pret MtO)
dorsie per > Cérint » 100°°
2 So-pin(” Pesientye 2 pe);
) J 4009:
3
Ls .
¢ ‘ Soph (Pall In)
Ip (py)
$ o-pln(physies oP)
IE (p34) ‘
Lip (neem neo)
if Crem) 3
Soph (1 MIs tmy
if (oc
S-opin[™ Ophir)" +o)
m=
—
=»
=»
==»
=—
=
=~
=~
=e
=
=
=
a
=
—
=?
rCordibon using & operetar «
Promo
Dlahen at y Sub greater than 3 Coleulare poncetye.
PE 35ST 3 Seeond cass
PA 69-9 4 prs? lass
per agove®d 2 alishwudi~
public class pe
: public stase vote! monlshig exps£D)
¢ pt pr34, C268, mM? 4,
Ink ovat 2 OF
double per2 0-0 +
c
okt > pte 4mte
pr>(Gatele Joo) 400,
if eL SS” Ba peresD
TSH p> Secoral 557);
7
t
uge
be:
Note te hen we have nested if , it B possible bb mexgetem as one
0267,
if Cp 73488 BG hS rm 2568.0 >34)
LPO COCOOCCEAATAAAAAAAAN.Saeed aC CECE E II IEIFF EL:
iflpaAr? 60 34 per <274)
Sapper: out petetin C” First dass?
elie ifCpr>=%) \
Sastera-cot pritd in (> Disnaehion),
yy
z
oe
: Syshorn oop prirtln C freith) »
C au aye
Me Poe our protin @ Physics sy
If Cc<3y
Sushenn “0 ut priain 0% Cham isreg IE
if Cmesy)
Systema out «prides (> mors,
IFC 0 < 34)
Sysheom auctiprart In ( + 0 pptensl De
9)Lae ena
Q. Type = "equlan” Pissa > No topigs = cheers prt
prite > 1905 hye aig o
“ppg >t rue |[-fahe> 40 /- 15st Phoppef SV acat price
hoppig2. = huelfaise
chege = tuel fale
Gst > 187
‘oppitg] & hp prs? > 7s/-
ches > 8o/—
AVALALAAALS
public oss PYUSEX
t
pubic stab'e vord mou nCshiy args J)
3 2.0, tia i,
(ak prvee 21 SO gRmIES tpl tat
ines tip t= true, R= prey FEMME
& dousle Fo» tottl* 070)
( iene = hae nate hee kpeaaanre)
‘ un” ¢ pie aoe oO
sean ot PS Og Glad Hote B09
ge" De ge prite = poke pice
7 if, 2a hue 43 4 22 False) EA
yor wl pte Hoy ‘0,
‘a You i eS jf Cer = Aue)
fi 3
Co in
ee np no VY i ae
P price = pace +62)
ALS LLCO CLEC,SSCCEEEEEREECEELEELEELLEEIIAITATAIIAGE
))
My
9> Grice «)3 0) (1000 4
pal 2 pre WV
System buf ‘pribd ln C
5
Asshoment
Abposit With panarol [io need f]
BPD los? 2renebysLB type > “ieegutes pga ounces OE
Tepi i we /foue > 40] nigga sitopp ly IE
rennin piggone type? Mae.
cheese > hue/fpue
OST = 18%.
Appry! Ribpprs2 ag /—
cheese Go/—
public class PUFA
, co)
e pebuestene void rvesn Cary anys
Shrity ype 20 Replay "4
double perce * SOL
Loolen th ohue, Re ug -
Syphemnrocep prntin CPG GA YP yer;
y Jern-out purer Orig thal pase 2 APPL:
sje:
system oed Pr Min Iopprigl # "FD
Sys benvouhiprjbdn (> joppy 1 A hpp'ya RY
Sephern tub pid Ep re cheeser 4h
His 2sue ah te>2 Aue)
pul epricep rs)
Wltiohne Ab re ope)
pie apricet4o;
if(th cove)
pice spree t8. 0)
cae hues
PILL CCLA CEE LAAAAAAAA AAAASASSURE I EFI EES
ch 2 zhu) ’
y Conprrhilehary graby ovsfrer hee!)
pPl Pl = 2 Ue bs ty22 Auer 4
t Systermaud pitino
Systern.o es ported. oy Ase elise? buy 4 get behind
tons 499°);
; | 0) /400-0-
Aousle 95% 2lpre +/o0 se
pile a pole 4h,
SY she ous prttn (7 4st L499);
‘ cose Hpr loos
Sysemour pre’ fo fort
a
o
g deposit with parece Wo Wester yd
pubue Coss cleposi
public sabe vo id racu Chri axl D)
pe pi 2N22t
Ie balarve > $0000 /
an
boolean caret 2 fo? a
Syshon ae prdin(- a pedanie befered 7287 1 Eaalancey:
“(pin ot hoz)
C F anouk paid [Estero vrvorg P)> 493
PP pre eitea a8 amount « 000008)
C falance 2dalanre Famounk!
Syphem, avd prndin( falance af! depos)? ="tbslensed:
quount 2/2000)
syour 72 1000043
IF Gir 2 122-84 >
pancort aokue)
fotanior belante paqgmourt >
4 balance Fe adeposip2"t
Sushem out prvdtol
Balan? j
Tf lpr 22N2r2 ao Crowne” > 3100000 8d prot a
Sygtern ou prrgdy (“ey vdig USE Gar pred
aepost I) a
: =
3 =
=
(Ox J ~
‘Come
pcpnr al
é if Gar tooooakh bertesel strud) J enone
balanref ~ anwunt ) al
obs x
Sysherrord yairdin ("Lib peonled?),
3 =
whe
syste fo CO Tivo ped <
SsVUITITTT
SVVUUN CELLU bb ddd ddd adaddite
\o
Whethey the pewon Is
elignh le pr Trberview or nor.
Abhishek Gof wax® Solutions
Quaifiation 2 B-feh
yop 022] 2023
Sheams cs, 1 geo
(odes - lode /—
Ter! 7
oe ee
m- ites
4
one IS
oe mA =e eC me
sauay 7? phy Ce
pond 2 1a man BEE peers
Jocahomn ! beangelove MsSo-S cH =H
on 8
% lode of glote*'
. ‘stode >! menor :
g lode ae yy 220ee ww cond hen ps fostee!-
ue sewedSUVNVUVEUVLULULULULELUE EEE AE EI I IIEHG|§)os| Sone
Objet Oriented Programming
Language. decg ,[™~ alepench
Vava is an object Osuented Programming
on 4 (eBe concepts. They 04° i
) Theritance
D Poy morphism
D Encapsuohon
DIGIIIITIV
4) Abstrachon
These 4 conteph again deport an anothet Too wont ph!—
» Cas ¢ \
D bje
upon class and objet.
Tenspe jov anally aepret
fo hence th name 0b jer ovented preg ramning-
(ove jovee ) Trwsbarce ;
5 ) Chass
D) Polyrrophi5M
liv. Jaw. y
1 ; J tmapsuabor 9) objet’
/ ycumeworls WD) Pbshratir
osies of gars Conepr
How many oP: Conveptg aye thee java?
Sn fotal we have 6 00% lonept - Thy aa -—
plas DI hevtane 9D Guapsuohion
po get Polaproyphis™™ 6) Mshachon
VUVVVUVVISIIIIII IddLless 8. Objed-
(Cea
“Objet 1's gq Keal work! physical ery.
ae pop of alata.
* a block of Memoxy
“Object consist of hve properhig
1) Saje > Ropers
» Behaviow] » funevo
ean is Basreatty on athibute of an objet 27 He propery g.
an obet-
Beaviour!~
Behaviowt sepreseng Hho athion poforrned ty an objet gy
The funckonaus 3 of a objets
Cla. : mould Tas Cla haatian,, Chor
Cee ud Shuche, Cobyeck)
(cas
» Css ts basitally 9 ple poh, dengn or @ plan white
provid fe Shruchue for an obfed-
Note'— P Wfrout Cloos It & not possitle b rate an Be.
» Using One obj clogs we can creale. raultple.
Merkal obecks
Kapedive ches 1 needed tn ovdee
hele obech
PLP LLLLEEEERITTTLDDAVASVAADVADLAAANS7
Tegbee
jramerj jo
company 2)pr
Salety XY £000,
[emer Shivani
lrompany as
5 alacny > 000
Object Creation.
a C34
fassname containey-name > New Closstyamne, C22
dass Employee
Co
puov’e glan¢ vord moth (Shog age ))
é .
aw Employee cy
J
} ,
Awl — class Pon
: yrs He shase yore mots snag exgseD
; &
now FPned >
i ne
Z \
POSSESS ERO RE PPR PPR PPR RRR EEE EEE EeCass Mobile
C f pees
Puble stable vod mash Shing cxrgs cz)
pe Yc class Utah
c
public. sabe yard mantSN Vg LF oy55 )
oh
Wath wi? new Woks oy
Wath w22 ru wers(Y
Systeen- ov: pos Wn (bids
Sy shem-oud-prirtin CW
2»
PPPPPPPPPPREPEPETILTIULAULILIVANAN AYA39619aq
Objet
Hash(ocle Ryton
(rhera-dedinel]
Doves He obpt add yess 13 called as
. Abe content which
Obed Reale
Th jove allths oy
rete a a rraedl as hee
eds Al shed jn @ poveulat
p munany «Object Creation with defining wort the properhes,
Class Employee
a ;
/ Define Aoperes
Sh ing name)
Shrine company)
Ink Solos
peste slane vord main (Shiny apsl))
¢ i 2 fa : Gnpeye?%
Empley® ° ees
el- name = WSonu 3
ef» fompany my] |
ef salary eS 000,
a
cass bile raalene
y home > 2200 -
copes = gree, [=
a gre cs cole Tres
Sky rome 5
Shing colar
IW ples NO > hype Ene
pus theWe voidmanl Dey yD) er Pri a
é Bile x12 pons BECO),
Brkaud 2rew Bhecy -
a ve ail
Ml Kame 22400" * ah PY
«name 2" bulee"} we prte 2 225g
wey» Colpr > "are tn’ % a
1 AUP? gpa CY 5
y 0005
COELERVTAVAAIAAAAAAANAAAD
Cr
PPPPLLL\ ,
WWM ELLE LLL IIIS SSI F
public class TV
ee ped)
Shikg nor
Jn puce
pase gay ott woe pee
a» pote OEE
av og enue TH)
"Qnrepus,
gg name=
“led”
oa
a3. tyre
23. prce HLpusU'c class Laphp
2
| Shy bravely rae, prowess,
yb puce 2 #
poe Le
4
ghh'e void ynoin CSM aystD
Laptop Li =hew Lapropl
Ly. byard = “del”;
lt prerde 2“nspldon ng
Lhe provessdy * "By
li pre 2 F866
Lapp Ler now Lapp)
Ly. braret2 “hp 2
, mer wp lion” 5
Le. ne P ie
dd- proressoy a) sit
Le pect 62990, :
Lophp 13 2 now Lap
Jy. Brat > nappte”
Fie tents DOE
byes
| pro eseve 19"
a d600
pane VES
CALA ALLL aa aa aaySUNN aaa EII III III IG EGS
public oss Superbike
e
Shs model, erp/he, dopspl,
ay pres
ae shane vole Mash Oring ay)
Bfee cy’,
Super ke Ky 2 rer Sup s
v Kid
B . model = "kaasees /
/
Mg es
aqce
By ergyne > S
Bye fopsp eer 2 "810 pmph
Be poe ~
seh aia
5 eg /Me a eos on
Bo Lie 33 96007
Ba:
S44000 }
a
3. topped = tego Empa”>
we 2 1200000!
Bs poe 0. ysa class Moule
Shiig brandpam e, ee
pt - Pree
pub ghee yord man (Ship anys iG J)
é
Mobile My, > prow modi lee 5
pol). brancl 2 "Realme
> Dame > Bpra
nye price 219997
My vam ? a
Mobile My 2 new Mobile (2)
My brand ? YRedtals
M)° prame 2 HYP IPO!
Mg+ « prite 2) OF 16
mgs Tem 2 g
Molle Mg = new Moby Lec a5
[Mg avand® Napple”
My. hame iphone ya?
Mz pole 2119900
Mgr ran 2 6b
PELLLLALAAL EAA DADA SAAnf 8]23
> Declaration Ano Thitiavsation Of Properties
“The prowess of definig he propertis os tolled as dedaxahion.
* The proces: of assingning values ty the properhes fs called as Inthabpaton
“Thre are fie mays fo ikige © pepe! —
DDive
D Ole Kaente
Dlanshucy
4D Block
SD Method
Lobe Re fone Tritt cako
class Bil f a)
Sti :
mare? 1 feclanation of.
Shing colors
J Paoperties
Int pre; ,
public static void saan CSiring args ES
Bile bi = nme Bikes
i
bi-rames “Splendor; “] faitfaligahi?
birtoloy = “Black” of properhies.
bt-prite #750007
e)
4
[Direct Snitelzation) 7 declaration aud
cess Bik!
é Shing name = “Rohul's
vb sal = 25000"
pubde seh void main Ing
Jarbedlig Cia at same Gre
args eJ)
Eimplyee 2b on Exployeo
Employee €2 > neu Guployee (2,
agi. satThe linitahon ov clawkact of rect inihelietion ¥
objets the proper hes will be ossigntel with same values:
Object Reference
Class Pen
t
Shing brand)
Shing voloy;
iat pte,
pubic stan vost mang hip oy)
; Pen p52 rew Poul);
pao browd = aml"
plpitee Uo;
p2 toler yee
Pop pr> new Pentl;
pie brand 2hamih’s
pd: pre 40
prrto lor ot blur
Pen p3> newslon (3;
p3: braansht' Coren;
p2- poce ?
p3-colore “black ";
Doe Toit poy apes Adee
An objets
Same Valu &
Ineigahon
pike bb a rewtibetys Ihe
Bhronaes 92490"
BleCaluys "eeyeegn | AE
; uo
bleprite aiitva,
fr all the
dass Pen
g
ne
shy brard 5 "Canslin® 7
Shing colov*
a pier 4,
public stave 107 wooly
art)
Lf
Pen p, > new Pen ld
Pyecoln ? Red” seaport
fen By > tw Pent2s
B- (olov =" blue MW Gp
i PEEEREELELE EE EEE
Pen Ps? pov ens;
Q-wloy 2 aces
7)
a on
Oye Thane Snider: —
[ Bike herouy
1 Obj 24mg BIECY 24908
: “
woowrace, |RSS,
lob) a1uxe ®
Loo 5100 he
ae~ Constructors
re
ute B® Conchuchy ?
~ > Ars)> «lonshuthr 1s a member OF lass,
‘Cons hadby sq Spevst - Methed
DP wry ole we need toushudy J
Me 42> + Ohject Creation
+ Dnitayyahin of Properh
int habe atin of preportin can 52
Gal
Note: — Object Creabon and
done otsame hme.
Gbddd
~ > Yyntax
mera me lpa ramelerS)
e
LU] ras hrach ons pr inj hiolig aP?rs
2
; pane and) dass narae muskse same.
Notes — lonstrucey
eeebedd
a Cons hackers !—
re ype fons fruthors
- pD gest Conshruchy
2 user clef ned lorstrurby ~
4
ae dats Bike
soy olefeeel Ceonsrruchrr
Ge Conshruchy
fo uu
public das Bika
2
MNSVNSVEAA
Agta consravet narvpsihe por we~defautt fonshucby and user defined tonshruchy Cannok exist
at same hme.
Nater—
‘ Conshucter - not ey cating. Tt is poss ble fo ¢
Consh uchy by creahng objet.
ir veo e
+ In Osdes ty crate a conshurry rnuttiple tinge Ww @ mast oe
rautti ple objects
pubic class Bike
ft
Brket)
é
Prsiem oud poorsin ("| lonshuvby ny
J
pustic sili. yord man Ghng cy ary)
Bile 12 nw Birkel
bike b2 2 nw Bikey
a
QOulput ?—
ConsfrucrY
CorshuPr*
‘all oy mvoke.
DPPPPPPPPPPPPPPPHRARMRVRGRACAAaaeaaananesé—
P18 fez
~ Whenever the proper aw not Initiayped in any ways pce. |
\ defautr Valier wil) be aesigned
“
™® public class Employee
‘\ :?
‘ J Shing nome. '
a int Sods
» prove ebhe volo men Ching arpslD .
é é
= Employee ef sna Employ eel
~~ Systemouksprinth (el rome);
ie Sister oud pritin (el-sal)}
=e
3
sy, Ps
es, ae
=
= by, sak, int, long 27 ©
Bd fle” olouble 0-0
ie 2
= Boolean ° > alee
=e ee >
ie *
= Clas Bike
fete
Sal aes Riket)
2) xO ¢
- 5.0 opha( Cons fruuiy)»
- 3
- prseve mt) [>
- Bike bl 2nw Bikecr
Ee Bike be~raw Bikes yy,
4 aBikel)
- rt PB o.pb"€- Hed y Ox
|
| class Pike
Sopl Bribe); f=—
S-o-b0? C-end"))
public stable void mosh (Shrivg opslD)
£
Sopl “Sheg’);
By'ke by > rew Erkets’,
a0 blogike”):
eee eae news Bikey)
80 Bh Grol “J:
Detar ! —
Var
C- Spear
Byke
C- ered
Bi ke
C- Stoo?
a
od
—PPPIPPLPLPPPPPPPPRPIIITIVZILVIANAN\
S
\
\
‘
~
“s
ss
~
~s
=
=
=s
ms
—
as
—
=
=p
ae)
aap
=e
=e
at
mt
at
ai
-
-
iS
of)
SP
ww thls Reqword $ at a
pub vc clas Employee
ti~2® ae
D2 Employee)
€2. 299611ay
ef
Sq ster ouch» priatin Chis)
——
pusue stake vold man Sig UpsEID
: uc (OD
|___—_ Fntoyve e/ enw Employee (Ls
Gnployoe ee zneus Gnplogeecdile
S
Wy Emp toyedreyaf fore ap
i Een p 0 eO3P 761799 -e2r
employee dying properires, rane, salary
Create a ass a
ey using consyucoy. (rede minimum PR Objeds _
a ,
eaitiauize The prope i
ee es for each abject
nd priat ho detailsSAKRAAKAAAAHA
pustic class bimploy © ®
t Shing rare;
shar Sab
Employee Saif 0 pnts)
pnis.nome 203 JER
Hphy'p. 30 25
Sf cD
public stas’c vord mash Cony OF
£ _. Feb 2 new Enplog¢ (kate! j ees
Gmploy ee e) ¢
Empte gee ene
System, oud proto
spleens Pees
q \
2 oq. |
ner Crpry et [' Je "Booed;
(epnrame bh” "Le sol)
([ename 7 “pee. set);
ii ile he oe @ 6 8 68 fe 8 6.4APES ESSSESEEEE TP ROPER REESE EEE
public class Employee
t
Stig rane!
nb sal
©. Q Employes Sori ”,
v
it S)
Shis.name 27>
i sat 2
ue sfahic vor! mah (sh anys)
hs ¢
Ernplaye® (CRghul’, I"Ss000);
> saga)!
Ernployer 21 2007
eee Ennploy e€ eer paw Grp!
osteo out ptt! fepramer ” “relsals
(System. our retin
J
yee Cevishts,
(ea. rame + ag ex sdy
Outpa:-
Rubrul 25000
gerishna 29300jer_num ;
é WO
( DZ] Phiae rome, 100; jog? Sal]
@ Sind : In Pan
J | DY player Conny ” Sty *, 5 oO nur)
|
|
this.name 2n>
4s. feam 2t
4S jet_num >pum;
Q Create a clas player dyjne Proportiey name, team,
Jersey neumsey Initiale dhe proparbler usibg consinihsy,
Create miniwr three object ard pit Pee propeber
= MS Dhoni
wad, objed-- tee a
a4 ran Sat a
nobygn a
: ei
Suslic Class player ee |
: ou Te pawn)
a
ee.
plogen 42 rrauy plas eC! Fre! ‘Ay ‘or’)y
Payer Ps Pru play 4 (Viat’ eee’ 1021),
Sy shen out ‘Parte Cp. pamer” "%L Batormy
nh JA) >
’ Syshirn ubprnd in B nameyt Piva “1p fru \
\
X
‘
Sysherh ous prt (3 -ramet" Pa dame” og io maisFUE EEE EE II IE EEE
petentage - itielize them using eonshudy, Create rai ninus free obfod-
Quel print the delays,
:
~ g Creclea class Student define properties name, quabftalen year of passout, eo
public clas Shudenf-
f
Shing nam, qual, bronhs
Int yp
double pers
Sheen Shing n, Sing 2, Hf
&
L, it 4, boule p)
this.name 05
this gual? gE
Phi. (ep Lh 7
this-yop 2
this porpe
3 .
public stabe vole! aos Shing apseD)
é
halen! 51 = hens Sudeat " Tp", "Blech? CS; vey B).
Qhude nts) 2 raw Studer (Navas, "ged "C8, 403, HY
QShuakat 52° new Sheet (Bam, "2" Bépy’ 2014, 8D.
Qi stermous prndin(SI-rame +" vg ghqude” “9 sh brenhs “Yy
sh-yope "+ 3). poe
Sys tera oer prvttin Corrname 14. gualt 4 $2 branep Ib
Ni Hope v4 Rpas:
aston oud frist (83: name tT 88-gund #8 4
$3. branche ys 2 yopt "Gs peDt