0% found this document useful (0 votes)
21 views

Java

The document discusses the history and development of Java programming language. It describes key concepts in Java like classes, objects, inheritance, encapsulation, polymorphism and more. It also explains difference between JDK, JRE and data types in Java.

Uploaded by

vokada5794
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Java

The document discusses the history and development of Java programming language. It describes key concepts in Java like classes, objects, inheritance, encapsulation, polymorphism and more. It also explains difference between JDK, JRE and data types in Java.

Uploaded by

vokada5794
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

O'What is Historg

To!
developed bg Janes Ghosling , Mike shendan and
Naughtan. Ihe þoject uses caled'Caseertalk and Patid
|he team developing the brojet sere called
its extension was.gt
sas just develo þed fo embedded systems ngtthe'Gyreenteom.
|
machines. uhen he þrolec oau Ginithed, for big and compex
ore membecs et'qveen
teom'
ituses tans feed wa
and ofter the develoþment,
to
Nomed 'Dak'. [5eve wa it
anottes Compony naned 'Oalk'
decided to change ta nane
Ajter gatheing many so feom
choose Tava
becau e it was acotfee. names,theteom
a
release þadlicy in l995 b Sun
Micosytemu'.
Who is diffesence betuoeen Tava and Ct++?
Sorme imþortat ifforence beteen Java andC+t axe:
) C++is platfo debendent,
bat, Java is plat+foom independent.
)C++ i mainy sqsto, langunge hut, Tove is mainly
) Ctt isa 00R lnquage, ut, apcation longuage
Tava is neary lo0. O0ts
iv) C++ sabpta
multile inhetance ond operator veslading languge.
Sapit d none
these features. butJava
Av)C++ has default arguements
bat, Tava doesnt sSubarts
3ohat is diffeence betuween JDKTNM ondJRE? t.
JDk: t stod tor JovaDeve oþmet K+
T+is asotwre
development envioment shich is ued
abpications and ablets. H contains a to
develo Taa
feuo othec Tesgurce þivote Tum od
such au intesbretes [loades
CompilerJavac)an orchiever joua)r aa
Cjavadoc). Tt phyi jor, adocunenteti on
genesator
caly exsists
TVM:T+ is anabstrac
becouse it does+ nachine.tiscalled
exststs pryaicaly. virtual machine
sheciAc java untime Iþrovides a
Can
envisoment in ohich Java, hyte Cydo
be ekecuted.
Hcan Tn hose Cudos stch is on ffen
in ony lanquoge but comiled in ytecsde.
TRE:
Tt sa Set of sotwae tools ushich ore use to develo
Jova apicotin.
u
He used to bKOuide theetime ioMent
the impergentetion TUm. -þhyicalyexsiSta.
what ia clais and obect io Jaua!
JassA class in Tav. is set d obiect shich shares gOne common
behavious and attibuteg. T+ is notareal wodd cntity
just temHate er bluehnint Itla
A
groub otbjects
classin Jon Can contetn
(()Athobutes i) Metthoda (ii )Constnctor (ivy Nested
(U) Trtes-face
clai
bijec: It is boaic unit Tovo programming-T+ is a seal-world
entity An object concist of Hhree thing
C) State:
His rebrsented hy attnbtes.
(n) Behauiaur:
Iia sesresented hy mettrds.
(iDTdett: Tt comnonda to give caniqu. nane to
eve
objcc
5 hatis chstacion inJova? Exahuith eal world exomple.
Sisstractioni T+ is a þOcess ol hicing the implementation
details anc shousing onlys
essentialfanctiondy
to the ser.
Real ite exam þle can be he ebsites spened in our inehile
phones, n appication
rning on ur cOmkuter or phona,etc.
ohat is encapsulaion in Java Dxplain
uithreal usvid eanble
Sncabsaton:It is a fundamental Concebt o0Ps Hhat
veferg to the bOndling
methods wsithig as singl cttibtes
ond
class injova. unit,hich is caled
Real ife exanþles can be a
mecdcinal casule, a stetiona
box a
hat
schss bogi etc.
ia inheitence in ava) Explan wtth eal lye exonde.
Inhectonce:H is one the importast concebt oDPs. TAi
mehaiAm by uohich aclas is alous to inhert
4hefeatures fonether. Tieclaus nheitthg the
onother clasi callodsehclas cnd the cla giving
Hs aa
sopeties called superelass. There are frur
tybes of inhesiten ce in Jàva.
)ingl) Muiltiev Hiexerchical Gy Hytsd
The besh examble o
inhenta ce ia the humascoluion
3

hatis þolymorfhism in Jova) seal usord ekanple.


Explan with
Polymorbhism; is Considered a ono the inmþortont concept
aous us to
t an object oçieted longuage. I+urays.
þestorm single action in diffeset The uwortd
"þoy means 'many ond mJh meos formy.
tt combined mearu tha abiity totake mutiple
tona These ose two types þeymophism in
Jawai
() Comfe - tine Pcymoopin
i) Rug-4ime Polymorphism
Real fe evanþle cold be a
qud who is a studet, a
claughte, asistex o
acuife yetc
)ohat arethe þintve data tahes in Jova
4Pimitive daatybesi Tñey ore the buildng blocks Sata
marihulatin. They are only capasle. o
ot
halcihg single type valie ond doesnt
tes ant spedal copo.bolities.
T+ is one of he reayon ohy Tava iTo0 object diente d
lGgunge I is eight tye.
Pgimitive datatyhe4

Soblean tyoe
SNanent tybe
boolea
chasactes valu Trtegral value.
har
Tnteges Floating -point

floa double
bute shot int long
(0Exblaio the Concet of
A
"tue
i
cauting" o
type coNersion
>Tyhe Castng: daype converted ito anhe datatype by the
Command od brogrammer wing cautng operatos. can
be aplic ocomþ cibk as oellas inconpatible It
dada
tyhe. We do typecasting-for situatin cohen the
destnation is small then the suurce.
Tybe Convessios; A datcctype is converted
hto anothes datatpe bythe
Conpiles. H Can be ony applied only to Comþotble
adatypez. there isrlt need for Cartng operator.
The destinati anneeds to be large
thanthe source.
Ochat is the pusþose of he Stsing datatype nJava?
H java stong is a Sequence e characteg that exsisis as an objet
the clas java lang- Stoing Java stings are created
manpuiated ttrough the and
ttlsvalue cant be changed. sting clas Java,, asting is imnutable
Tn

Prsamto esesent stong:


þubi clas Man£
þublic. staic void main Csting CJ
avq)
Stsing ane = Sanjeet";
String name = Nee- String CSanjeet"))
Sgstem outhþrinth ("Yous
Stsing: "ynamo;
3

ohat is defaultvalue of the boblgan


The defant value datatype- in Java?
the boelean datatyhe in TaNa, is
false".
3) what is Ohesats in Java!
Oherator:Java eheratorg are
arethe
thesymbolg
Symbolg 4hat
that are (ued to pesform
on
ohesaion vanables and manihulate the
oheronds.Each operator perfom vale ot
Java has thsee tyher ot oþeratorssheciic operatiDns
[hey axe
i) Unaay operator
(ü)Binay operator
(ü)Tesnong operçatus
5
Diffenticte betueen natBinngyand tenaybpevag.
-Unang: Uoans oberator reqires ony a single olperand;
is to incremert
wed or
his operador
decenert he vale negating un
expressin or invesing a boeleon value. Some of the unany
cheratocs are Bituoue Complemet, Increm ent decsenant,
o
Onany ms,
logical nt os instenceof.
Sing: Bnay oheratorg reuires two sperandy
a to þeform
oerion. + had many tybes t disfhct operatosa.
OþerotoY; thcome undar
iJ Arvthmetic lü) Assiqmet inay operatosi
ii) Logical (y)shft
uyBtuise (ui) Relotional

|emang: The oþesetocs that requres moge ttan tuo


to clo c oberations. oerands
ft is alio a
Sheratu%. I+ is somelhihg ksen Conito nal
a simple szy. Itis a set oike ifdde unsked in
that wosktogethe. to operator
sbo L
Syotox! setusnstosing = (Cnditional
xjsressio)? tue
Stetement: false
15)hat are contsol statemert in Jova! statene:
The stodements
baued on
hat contsols he flous ef eXecution a
c pgsam
ceten con
tiong.
of apoqrammihg lanquage. IHere are
H
is atundam entelfe
atures
stetemeta in Jova. They are: three types of Contl
(iDecision makingi The se ase the statnent uohidh executes
ushen ondiion is taue ocfalse.The its code
flous
by Condtidns setuming a botleon ualue.iscontolled
(iTtes ative The statenent inside tthis constuct ll be execued agan
and again uithe Cardition becanes false og
Staten ents maes an Some jup
interupta. E+
aho calrd stnq
totementz.
iy Tun: THese cre the keyustrsd in Java thod helbs uu to
contolthe
fous pogrom and direct in one cyecion. bseak and
o

Continue asefwo junp Statements.


OWhatis obesoatos þsecedece inNave?
he oþettor þrecedence sebreserts hos-tuo exbgessions aYe bhd
togethes. Tt detemiber the goubn od bperaoss usith
and decidec hoo epeond
Paxentesis a9 Xers ion ul| be eVeluote.
Pos+fx
Prefix
Mlti picote
Addi te
Relationa0
Logical
Java Oþerctos Precederce
(cho is the wwe of te instacect ebeator in
Jan!
he IC anjava instancoof eperator is used to test wethes the objecc
instance of the sþecified tutes ike cda oS Selcloss cx
interface.TH is also ay
i+comþares the instencekon the companision oþerotos becaue
flae. sith tfe. Itetum ethtuo. o
Exanple : clacs Maio E
þuhlic tehc voi d
mainCstigC] ags]
=
Main obj nee Maunc;
System-out print (Bbj instencec
Man); 4ue
Elain the susith stetemet in Jova!
The stch statement is wet branch tetemet. Tie
amuti-
Jova suitch stetement ekecutes one
Conditionz. T+
stademert fru mwtple
is smilar to if- cse f -else ladder stetenents.
tþsoides an e asy ay to
dispatch eecuti on to different
basts of code baed on the vae e the
expresson,the
Con be o byte,
int,shct char oç int. Hbasicollyy tests the exbssio
vanahles cgainst mutile vaues. cuality
Sutch: His a
kegusord ustich takey on vaviable to compare uith
Caues.
Case: It Uscd to oite diferettetnet.
bseak: Tt is c
ed to beat dh Sutch stetemont.
7
9Ohat in on Asayan and t typs in Java.
Java
Java Array ig
is cbjet wshch contains elemeta a siilar
datatyhe. 5e elements of on array
nemn scaion. a
T+ is data re stored in a conti
Cement We Can
stuctue ushere we stoYe similar
store oy atred set o elemets in a Tava
aray. Aray
b
in
Java is ande based and the first elemants
stoved in tho th
inde.
|here Ke tuotyses +
(0uySingleDimensional Aays in Java'r
MutiDimensional Arra
Arrat
2hat is theae cf Jength vasable inaay
ñe lenth variale is a ublic vonable or «nJava
clos tihetug the cunent si2
orey
cttnhute arra
henIrdexOa-of Buud 0f aray
Execestion Comes!
t is ansuie enos that Comes ushe
Commandy to access tho
index in an arayebogsn
aninad
asy is 5 but youtay to access ind ength
62 Erlain the jauar ctil trags Sors.
The clas.
Ara closin java. util þackage is a part
the Joua
Colecitn Psameusok. Ths class brovides
duynamicaly create and occess stetic methodsto
Tava
ot ony statie methoda Aroy. It consists
and the cbijec t methd
T+hau many method in
the ela
may thing ike' cla, that helas to clo w

JHla arrc sth pasti ular value


(i) Sorting the Arut
lii Searching an elemont n
tw) Comporing amays. -feAay.
tuo
6) Hs do yu Sost an arayin cucanding
osdosin jova
To an
ort arat in Java we
(o TA we creade onaoy haetuo
uoith help
methsds. Tieyare !
java- hl. Afrray clas,
trontain -methd ohich fo sost t.
hal
i)Tt t Create oatsadiionol arraythan
dcta stuctue techniauesto sartit. uhwe to wse
he
( Sortng an Array i
impost jova..
utl. Arrays;
þublic class Mains
public static. void maincStrinq. C] arg)í
int C3 og = L57,3,10,73,
fosCint ar)
System-odt. þrint(i 4" ");
Asrays. soct-(arr;
fosCinti: asr)i

KAh
losgest ekerment in an aray
þuic da Maun

þublic stehc void main Csting CJ


arg)
int orr LJ=2514,3,7,0)
foxCint i:arr)
System out. þrint Ci+" );
3
na= arrLoJ;
it ma=
forCinti=1; ie or. length ; it+)£

Systernsut. fsontc
3
Lorget: "+ may);

3
3 Find 4he dublicate eleantin an arrat
imþort java. uil- Anruyi)
Inpot java, util List;
þubic clas Main
public stecie. Listh< Irteger> Daicates (int LJ crr)
Ist <Integer> hiatn = ew Aragist<0)
intn= a.legthj
fox (inti=o,ien; tt)
int index =
arr Cinde]0CiJ7-^
t=n,
3

for (int i=o; ienjit+X

cw main.
addi
Yetum main,
3

þublic static void main


(string LJargs) i
int LJ asT Ll6,3\,3,6ib)
=

List <Integer> =
ist
Desicates (aor);
for(inti: Gst) £
System-out: þint-i+" ");

6) ohatis coMmad ine asgement concept in jova)


JavaCommand ine orguement is a
arquementi.c þouss ed at
thetime od rning the Java þrogrom. In JaUa fsogramming,
the comnmodine orquemerts pasced from consde cay be
Tedved in the Java þaoghan and they con the wed
Usess con pus the oquerserts during be y
input:
the Commond the eKecuti on by
baing
he orguemts inside he main C!
brcy
23 Exblain the main
metthdin jana!
he main() methsd ig 4he stesing bsintfor TUmto
°a Java þsoqsom. without he mainc) method,TVm str KecutiDn
Cxecute the þroqsam The Synstox wll not
ot mainC) method iai
-þubie static veid main CStsing
C3 erga)
AccesS Kegurosd Retuntybe Method nome
|Sfecifier
type
Executeble rde
TH
is cote beten braces.
is enclosed inside
he fle hame.
no He cla ushich has thesame ncne a
9)
(ht is a lscal
A
vanable declaredvaable in Tae!
inside the bodu
bcal vanable.oucas we bthemotthsd iscalled
methsd thisyaable only stth hat
and 4he ofhe methds (o he cla
Qusese thatthe vanable sists. Tt aresteve
þublic. clay Moin Cont be astadi.
þublicstetie void main CSting
CI rqs)
int n= 5; /localvosiabla
Syste
st printC Your Nmber+n).
3
69)ohadt ii an instence van ahle in Jova
AA VOnable dedared inside the clos but outsi de the hody
method,is caled on instence
C
statHc. Ttis called an vaiakle. T Ls not ceclaved
be diffesentfos eveay inctencCe voiable, becawse
obje it UaLlu Co

þublic. clau Mans


thotcla
public ita,/| þublic isstance vornable
intb; Il defeuut façtence vaiakle
þuslic ctattc Void mancstingLI
crgs)
Rous- Cangou Create an nstace o
Tn Jaway
Aha
sthnlas in av
WVaing the Stings
Con instenized by
ayiqmeot oberotos Or
tuo nethsd i-
inþost java. string ternli
þuhic class
lang-sfing
Main
hubic stedi c vcid main Cstoi ng
£Iarg)
ing "Sonjee+"
System out- print ("Vour
Stong:"+nome);
3
i Using neus key wtad'
import java. lang. ursd'
Sting
þubicclas Mains
þullic sete void main(sting
L3
arg)
Stsing nan
nane
System:out.
=
neo Sting ("Sonjeet");
3
fnt C\our Sting'+name);
ohot is the spitO
(idex of(replacemethdu
yShutO: T+ is amethodin he stsng
clas tthat
usfs?
sting irto mang þarts. break he
) e9ex
a deirihg.requlatItakes tuo pasarnetes:
c}ression
Ú)Linit: the resbing threshold
Todeot): T+ is a mothsd thatsetoms the þociion o! the
Asst occuance ot cpectied chaacters) na
Stáng. The indey ot takes tuo moxiaun
in ndex fO) metho csguemeti
)a stotng ()asthg and indexfom
(Ma chosactes i)achorctes and nderson
YehlaceO: The replace() seorhes a sting
for a specified
characes, andetuns oneus stng uohoe tho
She Hed charactes Cs) are
asguemert. reaced. I4-tkestuo
(i Seschchar (i)neehar
32)whais Consnctos in Java?
H Consthuctor is amethod thot is wed to iniai2e objets. The
Constctos iA Called ushen on
object of a claus is Cseoted. Ican
be uwed to set intial values -for
H
conshmcts is a block o! Csdes obet ats to
btes.
ohen class is Cxeated. similar nethsds. is called
TH

MainC) S
Sgsten.ut- pint C"Con stauctor);
þublc stedic vid main(stsingC arg
Main ob= Meus
MainC,

hatic thepasfpase of Constauctos


Tñe þorbose constuctor are.
(tis Lsed to intiali2e stetes
(n) I+ infom us the ebjet with default value.
n) Tt Con fell
abt debendesciez.
u
abd+ the class.
S4ohat ore the tyes ot Constucogin
aTheYe ase +hsee types CorsfuctoginJava!
Tova
iDefcuth Constuctosi constCtos wth no
defaut Constuctos. oement is calle
baalic class Maio £
þublic Man C)
Syctem-out-þntC'Defeult
Constuctoc WJ;
þeblic cteie vsid man Cstoing
CJaq)
Main dbi C) = neus Maun);

Paranetesisc
liifaut ConstactosAconstuctos hat has craun ete%is J<nsus
foraneten2edcnstouctos.
þuhlic clas Main
String nanej
int ta,
Main Csting nane int
id)£
this. nune = naune
his. id =id',
þublic stete. void main (Sting C3
arg)
Main obj =
neLe MainC"Sonjeet"
);
3
coPg Constuctos T+ isa Constuctos that wses objet ot
Same cay that is cued to copy data.
þublic cdas Main

Stong nanej
iht ic)
Main(Stsing nane int id)
fhis. nome = name,
3
this.id= id}
Main CMain obi)
this.name =
objrane)
thic. id= obj- id
3
þubic static void main Cstsing CIargs)s
Man s
oh Des Man Sonjeet
Man
b > Deus Main(objJ,
3
orth
Can aclassinemert muHHeintefaces in Joun, Brain
Kande.
he isteerfaces in Jova is a mechanism to ochiee ahstaction.
hese can beony chstract nethod in ia (bterfaces io Java,
hot the methodbody is wed to oche ubto I00. abstrac
T

fion and mutile nhenteyce in JaNO.


ioteyface int
public void shsu))
public nt hellb0;
interface int2
þablic vid zed),
þuhlic int head))

þuic cla Main implemess int,int2


Aualic yod shous C)

þalic nt hello)

ublic vsid 2edC


þublic int hedd)

bublic sfatc vsid maunCStng C]args)E


3

3
)ohataxe the benttts of inheritace
The beni-fHs inheotance in Java are:
Ttalss Csdereusabi Gty.
i)t halþs us fo facibtate boymosbhisn
iT+ helbs us to maintatn rde.
ivA Ustd to achieve ahstcion,
)iA used to make Cude flexide
s
Can aclass inhe-from mulile classes injava?
No, owa
doesnit clous
clouses the mtile inhentance thmugh
because uutipatt nheitence creates on ogbiqity
4) Ohat is anexCebion in
In JoVa, EXception is Java
n
unsonted or
ohich occurz dusing wexpected evet;,
the exe cution of a paogrom,
imehat dispts 4he omalflou e ie, atYcn
lnsthuctions. the
kcepions Can be Caught andþrogan's h
PrOgram. ohen an
ekcebtions hondled the
an object This object- oCcus ustthin amethd it Creates
Cotains infosmotion iscalled tthe execchtion chject.
and desvdption theobyut the KcebtionSuch os H
rogsan shentthe
Srogro b exception and the stete odthe nme
ekcaption occurred. the
Explain
tte fr-catch blyck.
7oy sck is used to enclose
Xcestion. T+ is must be he codathat might throu
excefin has eeuYedtoin any wed wthin the
stategent nethd. Tf n
Yest of the stetemest otty
od he blsck wi
| not be brekthen,
exeuted.
Catch bsck in Java is used
declasing the type to handle the excebtion
excestiog within by
n
object that clas. The codch the þarameter ond
ty 6lock. bok mut be oftesthe
þublicclas Man
puble stetic void main
(string CIarg)
Systen- tut þrirt(3/0);
Cotch (Arstthnetcbxcepti
on e)
System tut. reinttn
C'Excestion: e. getmessagd),
3
3
WhtisGoau bluck. and t's se inJaua!
Tinaly blrek in Jaun is a blck used to exe cute
ode such as cosihg the imortant
socecs, etc. connection,setarha the Atm
Tt ia eKeuted e ithcr it excestiion hadled or iu
Kception ls not handl ed.
A Conteiny the ecessar
that isneed to be þrhted regordless oj Statem ortt
Os nat. 4heexebtion occ
þublc cla Main
þublic steicvd mainCsting 3
ag)
Systemt. pint C"D:3/o);
3
Catth
CAnthmetieExcestin obj
Siystem rut.
)
þsht("Message:"obj-
Cinaly
getessage0)
Systemnt.-prhtSomy! Not valuattd"J,

3
4oht is statiekespususd jaua
The stetic in
kesuwod in java
ent The stetc i mainy sed-for nemong nanagem
keywtSd
aclass. Tf a vanable belong to the class nottothe
or
methud is instas ce o
keyursd thes on Gneone CopH quaified with the statc
It Can be ull
cbicck the cla be genesoted for o
apied al the
to blrks,veneblo,
hethds and classes.
the se
hat is
sfatic kegwdinJaua!
stetic keqwod in Tova. is used tomake
VOablestetic netusdu ond
static.bk, static
nse
qualiied with the keyurodstetie clos. TRe cleenthat
bt the instence ceonnts. TA' majosare knousnas doys eleomants
feouresaro to sot
t5)Uhatis methcd oversdirg
is Taua!
Method Olesiding is cne
of the ways bt ohich oecan
Oneie time peynocbhism in Java
is a
tthot
alos featue
methsds
acub claus to bypvide
asþecficimplemontadion
already
nethod io beth prouided by its Caperclass. ohena
suborlos Cndsubclas hos some
(method nome, Siynatns
etumtybe, Same
Sabclas method is basametes)a then
tnethoe. saidto havo oveided tHhe the
kubedous
fublic fuy)
þalic fu ()

clans B cxtends AS
þullic
fnlo/l oNerided method.
þahic fun 2()

6
Housis melhsd ovesradirg ached in Jawa
Method oNeslgacing
nane cus
diffeset method to haUe -fhe sane
used tobt achieve"Comple-fime'
teit sgnatues to difesentiete them. Tt is
boypm usbisn in
þubc closs MoinS Java.
þuklic void func)
u cid
þasic fun nta)
public
sttic vsid main( stingDargs)
fusC);
fun Cs
ADha
A ika package in Java?
java backage
þackage is
isaau goupoqf simlar types classes irtesfaces ond
ckagcs. Puckags in jcwa Con be Coteoqanted
ackag. uses dofned intuo typas, but-n
ond
, lang package.. heYe many þackages such au
ust,jauax | Swng, not io, util, cqLietc. Hcan
we tohcido claisos 4at are be used to

hy oe fachages hbtt.
The backage ied n Tava
has so mang
adwagtege, co, itis used hJ ua.
us
to srevet the nene
diffesest husposes. cecs
betweentuuo
They
aret
classes fus
) helþs us
fo Seusch
U) witththohelks ot access fos asþecilied clos Vey ec
inside os shecfios ithelh cto contao|
otside þackage the access
wt
49)
is a verH qurd
fos data-idng
hat is an
abstract method in java
The abstsact method
Classes or intofoces.isMehods
uedfor cseing bluebsitsfos
are de-fned
dorst þovide the insdenestdion. but thes e metthudy
beimplesmented Abstract method can
ing subclases orcloses
he intestaces. These melhud oxe that im eret
nt
Sabclases esþonaibility becausesometimes geffered to
sbecified #hey have ne inplementation
inhe supes cdas.
bYovide a mettod defhatiog. Aibclas must ouesido thento
abstact clas Hello &

abstract void sintitCo;


bublic class Main exterds Hollo S

Void þritttC)

public stedic vod nainCsting C3axge)


5Lohot is an iotesfoce in JavaR
he intesface in Java is a mechanicm
to achieve gbstracti on. Thexe
nbe nly abetact moth in theTawa ihtecface,nothe method
Dody: e is used to achheve
1n jova uaing interfoces.T absacion andmtple hhetace
oaothave a method body Tt aleo
ebesert he TS- A selationi
interface intas
final int o>0,
vsid dicfloyC}

class Man inplemets


inter£
vsid disslag
Syster.out tt("Hello Wosld");
pablc sletc void mainCstring J arg) s

You might also like