0% found this document useful (0 votes)
25 views12 pages

Java Viva Ques Handwritten

The document discusses the differences between equals() and == operators in Java. equals() is considered a method that can be overridden, while == is an operator that compares the actual objects or primitives being compared.

Uploaded by

Himanshu Goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views12 pages

Java Viva Ques Handwritten

The document discusses the differences between equals() and == operators in Java. equals() is considered a method that can be overridden, while == is an operator that compares the actual objects or primitives being compared.

Uploaded by

Himanshu Goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

VIUA eDEST IONS

ohat ls he diffoonle betaeon aquals () method cnd ofoato.


E_ualst) is tonsiJotd as a wethod in jaV -I is ued to lompae the
atual contontsthe object Equals ) method an be ouexniden.
= i s onsikd as an oßoratos in ua. Dt s ued to tompau
+ tOnLe. values ond objeus.This olortas tanno+ 6e ou 4iJen.

Yes, sbaing cla& is mak Ainal in jau in ostea to mape te staing


objgus inM-abla
Loha is iffeoonle betoesn toing ond StlngBuffea io java
sbing storing Bufey
"Sting is imomtable
Tt is mose. ePiUont in natue
as ompaed to ting
as lompased to tte ning

Soring 8uas sbing BuilJea


is 4S4nchronied íe theaad »Sting &uiler is non -Synckonj
(9un't cal he. ncthos o too t u an Call the
Gtming 8atey Simuttoagslg
sting Buffor is loss ofhciant Bimuttoreo&
Stiirg Bui)er ismoA eiciant
then Bing baer
thn Saig Bufeen.
what is ioteon(J method in JAvA?
The methbd intony sates an edac copy et a 8ting
objet in te
ViVA aUESTIONS

&tuche!
Esplain hg &tack 's relsiue data
IiS betaue Stak is ethey ompy it Consi% ob a top and the
Ust hich is a Stak by isef.
sta k an ceueue data stuctues Should be.
chy nd wlan 8houtd
Chosn instegd ag Asoays |(asts? Jsist

a Mee Speifc Manner then oora


s uin maaging go dota în
cnd Usts.
Vs ist -8e) implanantaion e Queues.
lonpane Asoay Based
Aorgg BaseJ Ust -Based

Si2e co leue &ho ald be Rnon NO neceLsny to Rroo te size


in adne.
SegLontiallg
Elamants Can be accassed odomly ElGmants on be acsed
only.
Eosiey to imple-ant. " MOe cOMPe d to nple vant

Ohat aoe the beneRts of clo gueue?


t an be ced fo both Fifo cnd Fo stychss.

" The cA uan qee. has betten anfo mane han a


linoa gueue
fay entaih ue ases.
ye ule Tivo intenfrce ?
ThtenfikS in Jnya aNE ustd to achiaue abstracion. tEoe. Can be onig
thheue. atstctien nd maj4e. in heitone in Jnv A
Moo Skatte bintng ond dyngamic. binctng difeon?
aynamie &inting
funch on is pnaon at tompile funcion Cone to Rnowat un
tine

" ate Bining

Qynamie 8inbig'
an toe oudiride a supo claas rethod coithout os clase as a
3 e hod oith thoos lause inthe sub clals ?
NOtis not ossible to tuete a sufe Clads method othoat a

tehing coln you oveyAie a ethod in q3ubelqss gou Must raintai


09e spacifC eabption handllng han e suprtlass
mehod
how do
Sub clas ?
Ta lavq,we can e Fen to the 34f4das uetsion ceg an ouosoidde

o invope he 8uferlalas implamantaion ofhe meihod.


lan coe ouer lee ivate methbs
NO, O Canno ouo ite oivate methods in jav. Poivq te. elhods
tothe (as ln which th0y ae elaod
VoA- bESTIONS

cohat is the tifEonQ. betoeon Edoption nd AON in JAUA. ?


An coor01 implies a fobØn that masty anises tua to -tne Shosthg
c Systsnn esoLNcas. On the otho hond thegaoptions ourdSio
Auntime nd compile hme.
U (an we just use ty insteas oy fnatl'g ond cateh bloas
yos,.it is possi 6le. to haue tog block coithout a cateh block using
a Anal Glock As oe pnoco, a fnal blocR coil aloays ede ate zuon
19 is an edoption oced in aty block eaopt 8t
Oha is te tifPoont b| NOcassDef FoundEcoplionEM and
lass Notfound Ecoption
lassNotound Eootion is-thoDOn on loo king 4P a case tnat isnt ont
Stntme lass parh 04 using an noalid nae to ook. up a dass that
sot-on A0ntime lass path. NodasSDEF Found E9104 occers cwhon a
coMpiad dals setoune nothey Cass that isnt on fhe
Munire
classpath
(oha 8hould oe caan up ach uifteg S4ch as TIo Sa8Oe8 lo the
Anaily block?
TRe fraly slock oill aloa An ik an uncaught ea coption is
lran
ut aoan -4p cote aft4 Te Hnally blocRif o0nt alod ifhee
is an aacopion. t e s .If g6u atch nd hende the eacophion
Han detation toill Coinc noimaly
Desolbe outofmemog Eo1a in eacaphon hnd ling
USualg
alocate. an object in he JAUA heg.In nis case iheganbage
collectus4 annot mape s{4e avai abla to atuomodate a noo ob ject,
and te heap annot be adpaned fuo
Lohat 1s 29101 In Clals (ast Exophon ?
It is a 9A4ntine edoption thato S ohan he appliaion ote
nona cas of ohich tte 0sgial
attompts to cast an obje to nothon
D6et Ao is not an instonce . ros edampa a stirg objec Lannot be
(aSt toan intage objeCt nd atompting to do Bo ol ssult in a
Class (astExopHon:

hend ling in Jav


e900s pescocad is ustd to detae cohich edoption an bethooon
fom a method johile the toroo syo69d (s oed to aapli ytoro
an eacepHon uothina nethod a4 bl0cR o code.
UVA QUGST IONNS

SiffoortiaBe. betoeon oros ond thoaad


aoLs398 ae bosially the roims that coe, tHspatched fom the
aody stata ohß as 0hadtuled in the CoU for edechon
PLB hols the orncsp ag ororss

Maliple hoas nd these muliple thoug% e lontained coihina

Rwhat is the puo pose oF oai+() tmethod in Tau ?


The coait U ethbd causes the toht tord to coait inJeinitoly ustil

Ohg must coait0 wethod be caled fstom he Synchotenied tlck?


oait Must be olled FaowM te Sgnchoni2ed block belause -they
IOuse, a lock on the objet s moni tOand iE he lock. is not held
an lega MonitostateExu@Hon coil be thoo on
D ohat is hffoone betsean oait () nd slaapl) method!
S The Mj04 GiPFR9one is that coalt) relaases the lock cohile slap ()
Jont seloese cng lock cohile coaiting . coat C) iss uses aon intesy-thag!
OMMUnitation ohie sloopl) is used to int0dalad a pause on edelaian

all the 4an) mthod insto e Stt ()?


Can e
yas, oe Can call 1an mefhbd dig Onlg diffoone is That okon
Stat nefhod is alled it gtes a dporate call gtack fo hat
Hogd bet in cale kon Aun method is taled diecty Ftom Main
rethot,it colll not (Goqte a necs Call 8tak.
nos (lals is PEeont Fonom Runngb tntey face
6
ould be
Runnable. is an inta Face which gefsesnts q task hRt
1hoaAd is a as chich (yatog a nu thoagqd
On the othast hand
ohat abaut e daemon ogds !
Daeman -hoags ae loo Bbto9ity

uceyHegd as daamon toad iE ha thnd is


an lc mape te
Statad ?

seo it wn thnoo 0legtiasad State Eopion.


VIVA QVEST ONS

g ohat is the aAfeone betuseen on Appet ond a Jau Appliakon


inpendenty
Ajava appliation is q e ces oopAM That Can qet 1o914 that
edoCuted on a comptey. A jaU Applet is a Small gancate
Mapes wse af onothe oppliaton orcgam So that oe Can
t

Applets
what e the Restichio impo Sed Dn JAUA
Jeine natiue metho8.
oAn appet annot lod iheag\03
o Dt Cannot oniny togd as Lodgte Aes on the host that's
annot ake notok lonne cians Qdoptb the host hat it
o Jt
Care porOM
" tannot Jtt o ropam on the host thaty edeing
43 what is the ifooe blo Ppplet loadet oer integnet ond Applet+

Ragording te (ase coko an appek (s loqed olc he intonet the


4pput is loqdes by he qpplet (las Loqse ond is Subjec tothe
SostYicHog onfoced by the appat is loqed Faom the l kant's local

Lohat is he Applat cas lo4dey nd cohat does + aouik?

Auntie theapplícahon nd (lases onSOSOras in -the appliaion's


(laspath. An app lat ios loqden is Sespons sbe fan loqding the
aPpts nd thoiy elated deses dhd seosoes Possibly ou the
ngtoot bg comnanigtng coith a web suth
Q5 ohat is Hhe Applet Betr manag2nd what does It povk?
Seusity a
The Appat mänge is a mechojsm to impose Osbhictions on JAuA
applets.^ABae1 May only haue ona seluoity margo.ha.
Beauaity manger is Astabl\s hed a 3haitp , nd it Cannot thant
be sopaced oueloqded ouornidn ay adtonJed
UIUA O VGSTIO NS

ohat do you untshnd by Co|echion rarecoo1k in JevA


The JAVA olelion forqhecoonk looudes a set cof
to imptement vanlo ws data Stouctes nd Sntefaca8 nd (asOs
the Linped ust tlas oethe (olation s
alg09 tthms. Fom QXample
foraresook 910uides tha
indenentaion df he doub|4 -|inked list dqta struchoe.
okat ene inay interfaces Brouited by JUA (olle cHiors Framecok
JhUA Colachons Frcre,cooR toutes Mng inter Faes set, ist
Auaue Doge Jond Oses (ANAy st ,vetor inpes Ust, BiohA
uue Hashet, inped Hashet 19e set).
Ohy coloion does nt etsn tha tloneabe nd seiqlr2q6c2
intos faceg?
The (oleHon intefae in jAuA Spei Ao, a proup a objets aled
alemnts.fhe maintainabily ond osing cof elamant3 is compately
deondent onthe conoet jmpleantatons uitd bs sach e8

nd Senia;2q6ce inbayfaces
hoo is etreiing infoimcton diffanorj in Ssh, as tngout

S9vlets get more help orcn the. Cennpiksy in catja

Hoo do 4 Benulet damine all its init fassaratng!

tonfig oec.
aat do Ju ean by &enulet Chainig
Taking he guguest Fomthe bow ger Loindosnd reeirg n

ohat is life yue contoact tha a Beulet ogine must orfonn to


Gote te sevet nd iniHal (2e t.
Manage
Destioy the Beruat nd ton the gAbaga lolects 1+.
svet get e naree caß the Joe ond he p t rontey
Hoo an

ge-souenfat )
How do you honde ieties in JhyA?

dnis method tapesthe abstpct pathng e as q fasaretey nd is

is GAted 34ttOsfuily else1tetuns false.

Ostte (intc):This method ositos q Binge Chaecken Sfeuk

oLite (stalng st in Off in+ ln): this method asitos q


Poion eß toing st iam in- oçe to jnt lan
ocaite (che t7 cbuf int off int
n)
oaite (onen[1chuf)

Te Buffoe Geositesy laUs caß Jeve s4pparts iing a Chain cog


chastack9 atpt stamlTeat BaSed) n an efiCFant oa.
Tha Chain -of - cha1 ctoos (an be
AAY Stoirgeta
chasract4 baled inpet team.

You might also like