You are on page 1of 14

what isinterfacce ?

Ho cen you UseContept of


inte sf a e mulhp leinhentance?. Discuss w
to ache
suitah I enemple
ane Dn tevfete Completely abstratt cless
uge d t ou elalt d methods wih empb bod
F oerfece Animal
Pubic voi d animalSound () nlevfe e menoe does no)
Pubhwid nn) han ody
->1o acess the inlesfece memods he nkslace mus
be mhlemenkd nneskdby anohercla
lkeywosd he offnkre r
body
he implemenfent
mehod s provided by implemeht class n h e s t
implement mwlhple inksre_e cen Smpl 3epeak
oin(omm
Eg inksare Interfece 1
Public void mMehod1 )
iptiece lnesere D
Public void mymehod0 ()
nkslaie,okeraa )
elas Democluy împlemenlS
Publ 0idmy Memo dj)A
gkm, out. rnt)n ("Tend
Ciass Mointls
Punietaht voi d main (St6 ng 3t1
Demo Cluvs m yob Oemb
ne» Cuss C)
my myMehod 20
mob my Meod D)
pG sa u n SwinG Component
mulbyly hO_numbeS Uce ent6 eld
and ontyuie, Yo nut
pmgya show d displap
Teu when prUse uthr
peckay NqOment,
Puhte elaa mullbply eMlenb iave X.swnJhe
pwnt mulhply ) _
int Componenk (O,
mvek vo) d Buhn LAdDon Peshi me
eventAchon Eent e) d hae .
int
Snt
intgi, pase lnt (a.t fent O)
Lnkyti paxt Int Cb. Tent O)
mut.st4 Jen C2 C
u h
pub stahc void main (8inr es[124
Je st Evt Quew. Inoe La (ne
unable)K
Pup)
new mun ply C e )
pvak ava Cwng 3Sem Pe) d a
OVe G L n 3 en Fie ld b
ave ewq n in Buhn
pn) av SAD4 5Label 3Labe) tE
no.3 wn puaam uOng wng Component
bnd np nest Vselen e l d
inpu end'outhu Youi choy
displa h e when pres
ALA IGn ment
pub)y clag impleors euten
oub)i
nitComponen'S D
1
neh wbd tk hclen Perhwyn ele. even} Ache -aHet.)
i înkfes, poKse In (p g etlent)D
dole h2 Owe passe Douhle roy et e )
int htege. pawse Lnt lrfedtenr ( ),
douled d :(erb tc/10o 2
puloli dhke wíd main lh_ COL
Jave owt Evatesnu lakd Cne Runahl 0
ubhc
nessimpie lok ).stt Viobll Chne
2
pmve oavan wi JBulhn Cale
ivah avan.sa Slabel lahel
povak avan. A abel Soe)
prah aan ) aheSlahel33
1phva avon.alabel_
an. SSentfiol
pria aaM, A1en Piel d
phvay ova n. su 3en kFeld
what is Jova beans How itdiffe at n hm
ava elass
an ave beans a lasses that entept-eh many ebje
inh sole obie Che ben), 3av beo n Clx
clcxsee
mus mplement seah ab hoyld hu
puh na) oncich and al peshon Mus
b oriveh publsc getkor end geHes meny
Public class Test Bean
mvak töng name,
pubic vo d gtName (stsng name)
thís.name nome
publst stúng Get Name C)3
ehim_ name,
3
Jove bean bacalyaae clouy hich Sahs
ow mple e ft mug have a publI
rbra onshu,no ub)i ingtan anah k
proyoesbiehou gek ond &ekn_Seva biard
O 0nall
ppl c h
ouldo bo' but emphaS sh h d
Lonodenhly ond ey hen
2 A Savabean' Jove clags but jave cla
doesnt have be joV beeo
J a v a beanfs 8 Specihc 1ave clus O nd hoy
he
les hat ha h be Fol)bwe d
eon
whymulthta ding gimoslantin pme sammng
Discuss the ife cyele ofin dela
Hhrta d
ans MulK threoding lbw the eLetubon of mulhle
esa _at_come bme, e s t Y)
artknon ag fhrta ds and an weiqht
pe eses oveiable wh n ne ptey
reulh mulh hrtadim
ublna on of he h mu fassa
Semeimpostan ce of mulkthrtading
Recure shasng
AllAll_me hrta ds of a
uth_ memor a,
oppebon ton ha
ame Cadd rtm sparU) tUu sha
b)Responsvenesc
Povgrerm pontiuneo P allow>
psCof t1Sblocked
mylb yhra dig hs 0n aln he do h
is heihioi perahn *
web b d wfm mulh hradi Ln u ON hKa
Conhac* aun anGha ma losd)
CUme Kme,
cUzabon of mlh bnessa Asthkcun
- h mul cescew aschikd, eath hreLd
Con on a dftetnt pexye n pasa )e
unn mulstorca diy bs inta CnguYen an
he syeAm
d) Economy
Tt fs mor ecomomíco) u hrtn ds a
the ban Hhe pntess rous
it s mbt empenmolA
and bme Coropaaily
consimi b
pnes Ses 0 mey rouir
and
more
mone
6) DisuLs bodes layouk los layout and ) d
lasjont wim &uinhle enamp
n
ede layout
n bvídes byou, comyonenh OM ananged
in h pi
we
osARAanoXh, gouM ea
ard enk .
18uthn T6 ne 3Buh n Ne
1Bun 612 ne Suh n " goym)
Jfbun Tv 3 nev Bu n (" )
JSuhn b oes Tauth cCenter ))
3Pone pane) ne SPone) O
pan e. Layout Cne Brdtaat )
hann el. add C3b Bord lajout léth/K
pann el., 8dd (iha, ord etLájou 0UT)
panne)add jo 3, Bordes Lajou EAST
panel. add Ch, BoxdesLayont bASM).
pGne add h , Bsdes toyout CENTER )
Panel
Nsh
cen
SOU
) laya
Flo layt1 aN ne dlefou lbycvisheM eompon
an onnAd indinchana lu
Buthn ne uYnn B u n } )
SBuhn i b 2 n e , Buho "Bulhn 2" )
uhn ne JBun "Bulhn3)
Jfen e hne ne.Pone) 2
pene. es Lejoy nes Ploslayct 0)
pen el. a dd ljbt)
pane odd h2),
nonel. ad d (ib32
c)Ce Loybut
Cand layo d e Comyonen
he Avxm ofecarsula 1he' ttlanle
disdedn eual 2edvcteng o ho one
orm xuncy blaled in emchret han
TBulhn b _ nes SButhn iBumn
Teuhn ih2 ne Bun "Bun 2")
Toutvn3 oes 18un "BuhnS );
SPonel panel ne 3Pone) ) , _
panel. cet Layout ne us d layeut();
pane). Add Sb1)
nan 2dd (3h2 3uih n uhn
eneoddjh32
panel.add jh ) ,
me se of ishmess handy even
guitable eNomy) e
onoin av
ant
Event isme p e nd i k i l a tes esponsi b\r
hondle even nt usheper)
w en Li esu
hecí e ecnb
wi ttet
he cOS pondhng
memo d Atien
even
inston of Mou Eint, wne MoUs Even
dees bum Eent obect. Event stne a
etnde jave, ub)" hadaj_
ejave ubEvcnHishes
he aiftnt pesof eveni lus)
) Achcn Een
-Achtn ben is gunexha hen huthn f elce d
he km_of h s) _double elfclee d
bJnput Event
e n t Uo m un cluc r all
nput
ecmonen é e inpu etnh
tkey bvent
_eneuid_on eneDa
Mioue Euent
u Event 1ndieaks a mou achon OCCUd
ineoroponen
)Sen Ent
he obfec of his
ela t prtyen h
even
.
oWhy Gdopher clacses nporen? Compan
wi 1ish ev nkaco wih omanple
Ons
Adaper cluSSes a Smporlont herau n
Ondo he deruld timplernen treho of lish
oesac
inof
we înhent Cne
the Odapk cl se
be us (e d de oplementa bac
enod of shhed Inkieco. , ít aus
Lode wth he moc mpcsh n rah
of codapks lass e
->
Tn adapBer dosses nert S NU neecd
implemenlahon o al memo ds pLe nkd
on nkstete wnex i n lstehedintestt
must be imblemenkd.
Lishnes nkáace IS wd mainl whfo
blanh ublize mos of he fnetere menod
whe C 0dapki cose 0M d whtn nee
me nod
WindowndowS Lismr is nkshcewn hs(e
ovey nae l of ne memeds wne 0
windos Mdapk allau w _ osnde menod
h
wse simple pDOY m
nd wsh h 6les
pacad e aconment
Sopust
impoxt stahc 10ve lang ckm.cul
aublit la SleREd
pubi sa VOi dmai n (stong I 3sg
l
le Reud e ne Ae hesde( nehle, tt")
Buttered Readedbr ne Buet Reodo C)
St
while C 1tk sbs tadline O) = nul))
OLMpnntn +"/n")
bT.co O
Car (10 Extphene e)
out psotHn"Eile not hund )

You might also like