Java PUT Solution August 2024
Java PUT Solution August 2024
Java PUT Solution August 2024
nt add ( int a, it b)
Rblic stalie
etn atbj
Use
hem
diecty
othont
and
into cacs 'MathUhls
imbaa stoe athUhls -add;
imboft stah MatUhls gubat,
Publie class Main
publc stak vod nan
(s3);
S.o-PHn(Addihon lt +
1
biscuss cotch and tna Socks.
Ans) ne elose thu coda
that night throus
sechen
ephen might
a
do
ees Lohat to
hare
ercabhon s than. Yn Cam
it Slesu
.
csteh (Exaephen e) 1
(" An eror occd
System-ow: pintln ("An
Sesond
'catch! lok sen genenc
other Cabhon that V
hondlen
ok
Block
Ihe
ophonal and
and tollao tho
cortains code that s
ereaad
ushethe exaho
cammonly sed
cdeanp achom, Sch ay closir les, releay ryoucy a
Lombd
cotdn o
excetions en
final adhoy
out prntln
block)'
Keu Considerahon
Orden ot eohen : code eeci a
Cateh ! and V han to
oamameten ist
( obhional t
neaded)
An
that achan
A body
lontbcda eruim
aslist"Alica !
nameS =
"chalie "Bat.
names then
lamba Exoralon
Ltetacas
I. colleËon
|.
P
Contn
The Beantatorg and ytphaenlontat
Beany'. Qnd
mechanlsmy
oterntd
A0P ( Aspet
Aceu / Integaan .
s)ota
7
oRM integahen
TiansachonMaoenen
() Neb:> web MVc
WebFlx
etiy
Searth
Fiomed Achilh
Sechon - B
name
Tolymorphig geans one
entends Test
publjc clau cfG
Public void metho! )
so PHnMeha 2")
PS V m
(shiny ay)
legt test =
GaFG).
tess method,
irplot
Combile- ime polynobhigrn stererenat antha oco
boumd totits
Comþle time this Rnoun athe
comble -
hme
metho by
th metho
called stahe caly bindy
achieved metho
public chss GFG,
pblie bic nt add i&bntb)
)
metm atb,
Public stie dobla add ( doutle a dolb)
rehm
Shiq ngl3)
So PHn add
add (23) sildwg
so PHn (add (2-9 3-0,
Discugs oole Conghu
beste he Cede
and torth the
Constude
Jana
evelndy
Consttons sheio meheds
/
cbect cf a
thot 'nvokd vshen
Ihe man
class cratd
nihaloze
Koles initiadze
Constvcdors thu
Oobjet Trihaliaion ensire hat
neoly cretad stot hen t s
valid
oijcct ( W
Gccesse,
aomahiaAaesa'
No Reurn
Conshvetos do ot hare a
even yojd? Thes
The name
not
etum lau name
math he
mus
Java constutors
( oroleading hane mulhk
fhe Same
construcdors otthin
have
siterentoomee
(5o), Calado Shape ahapealaaeri ne
be
dffennstvcos obects
(Shoy moin void tahc ublk
sde) (int fhan Area Calalat Pinat
tha calonla Method y
adiug adus
madns) (dotle lole Area,Ealalat dokl prvat
drela aa of ea alelat toMethad y
mea),
"is
Sdk + sida uitn Squarne f Area prtn
( out Ssten
si) shapelalalaa
int ( Pblic
(sid) consructor 7
Ohe) .+ is:
oth drle Area priin
nl out -
caleudstAraGela
(adus) double
vada) dousle calalator( shape
constto Public
class
exn7le, CvEHloac
Conshuctu
ANscuss checked exahhm, Uncheckad eraen an d
in detail
debne eoehlien
Aas cheched xetions : checkad Eabhony -ha
cheskst d -tme Ihs means, that
t lam.hred Ereefhors. t
CTate d by
fpliao,. These
handl a gefie
erashon extend cite
Custom uncheckad
public
3
thea and Thread life
ashich shos Tead bricntie
independort
othin Ihay allas Conunret
eKeouhcn
t task
efon snuaneo
Thread Athra d
that an
exeanti d
by Shedlen
head enablo mulhla task to mn
norreny She cPU tine
aod memory
Tbyea
th)s stt its
New Tha thead
the staut () method s
crcahon
1
ecbh.
ptlie clas
Publie sthe
Ihead thred! Den
Thread(ne Wetkynlbre d),"Tir
7 set pricrtes
thread d2. PoRIT)
thead shtl);
ttread2. stat);
shhe clau Workuih,recd imkkents Rnnable
Public void nlf
(int i = o; i<5,it)?
Sotln Thread cmet hncad () getang
0s
hndiona intoyou
'erable lanba
and method
chaacdeishc of FL
Abshract Method: A
(0rSAM
tee ahshtt
Ihis methel m contret
methad mefhod agorne
lanbh epreulon Y
S.oPh ( s is
methed,):
berehk ot tnciorelTnta
. Lanbda Sspruion Sutpet
Method ene
aana Condseen
Feadabilih
silotle olapl
ndCode and ty iA rsotu wih
Rilercots Jara &prmhs a n) featne
lgiase.
dodis
Tusday. nuwber
is 3 fr name day Week
(I-7):3 humber wWkdoy Entera outpuf:
nuber"; wekday "Dnvalid defaul!->
Saturday" taw7>
Thunday S> Case
wedneddey"; y- Cose
2->iMonday") (an
"Sonday 1> Case
;
Stn
dayunber) (week switchwekdayMame=
'; werdoy por-tl('entera outSystaq
Wekdayae claus pibtie
wtil*) java nport So
umber
912(0) Implem] n Aomist an4 adainy
eltme«fs cf "Soiy pe" to it, ato Iforahy 912
(3t));
onray ist. forEash (St’ Sytug out.ptt