CS2305 PP Ques Bank (2&16)
CS2305 PP Ques Bank (2&16)
Question Bank
!"# "
P$R# $
%& 'hat are the ((P Prin)iples*
2& 'hat is En)apsulation*
3& 'hat is Pol+morphism*
,& 'hat is "nheritan)e*
5& 'hat are the features of -a.a /anguage*
0& 'hat is the need for -a.a /anguage*
1& 'hat is platform independen)+*
2& 'hat is $r)hite)ture !eutral*
3& 4o5 -a.a supports platform independen)+*
%0& 'h+ -a.a is important to "nternet*
%%& 'hat are the t+pes of programs -a.a )an handle*
%2& 'hat is an applet program*
%3& Compare $ppli)ation and $pplet&
%,& 'hat are the ad.antages of -a.a /anguage*
%5& 6i.e the )ontents of -a.a En.ironment 7-D89&
%0& 6i.e an+ , differen)es :et5een C and -a.a&
%1& 6i.e an+ , differen)es :et5een C;; and -a.a&
%2& 'hat are the different t+pes of )omment s+m:ols in -a.a*
%3& 'hat are the data t+pes supported in -a.a*
20& 'hat is the differen)e :et5een a )har in C<C;; and )har in -a.a*
2%& 4o5 is a )onstant defined in -a.a*
22& 'hat is the use of final ke+5ord*
23& 'hat are the different t+pes of operators used in -a.a*
2,& 'hat is short=Cir)uit operator*
25& 'hat is la:eled :reak*
20& 'hat is the use of for ea)h )ontrol stru)ture*
21& 'hat is the need for stati) .aria:les*
22& 'hat is the need for stati) methods*
23& Compare stati) )onstants and final )onstants&
30& 'h+ is main method assigned as pu:li)*
3%& 'h+ is main method assigned as stati)*
32& 'hat are the t+pes of .aria:les -a.a handles*
33& 'hat are the relationships :et5een )lasses*
3,& 'hat is the general form of a )lass*
35& 'hat is the use of ne5 ke+5ord*
30& "f (:j$% is an o:je)t of )lass $ )reated using ne5 ke+5ord> 'hat does the
statement $ (:j$2?(:j$%@ mean*
31& 'hat is a )onstru)tor*
32& 'hat is the differen)e :et5een a )onstru)tor and a method*
33& 'hat is the use of this ke+5ord*
,0& 'hat are destru)tors*
,%& 4o5 is o:je)t destru)tion done in -a.a*
,2& 'hat is 6ar:age )olle)tion*
,3& 'hat is the use of finaliAe method*
,,& Compare 6ar:age )olle)tion and finaliAe method*
,5& 4o5 is it guaranteed that finaliAe methods are )alled*
,0& 'hat is method o.erloading*
,1& 'hat is a String in -a.a*
,2& 'hat is the differen)e :et5een a String in -a.a and String in C<C;;*
,3& !ame a fe5 String methods&
50& 'hat is the differen)e :et5een Con)at method and ; operator to join strings*
5%& 'hat is String Buffer*
52& 4o5 does String )lass differ from the String Buffer )lass*
53& !ame some methods a.aila:le under String Buffer )lass&
5,& (utput of some eBpressions using String methods&
55& 4o5 5ill +ou initialiAe arra+s*
50& 'hat is arra+)op+ method* EBplain 5ith s+ntaB&
51& 'hat are the methods under til&$rra+s*
52& se the arra+ sort method to sort the gi.en arra+&
53& 6i.e the s+ntaB for arra+ fill operation&
00& 'hat is .e)tor* 4o5 is it different from an arra+*
0%& 'hat is the )onstraint for using .e)tors*
02& 'hat is 5rapper )lass*
03& 'hat are the different a))ess spe)ifiers a.aila:le in -a.a*
0,& 'hat is the default a))ess spe)ifier in -a.a*
05& 'hat is a pa)kage in -a.a*
00& !ame some -a.a $P" Pa)kages&
01& !ame some -a.aDo) Comments&
02& 'hat is Command/ine $rguments&
Part B
%& EBplain ((P Prin)iples&
2& EBplain the features of -a.a /anguage&
3& Compare and Contrast -a.a 5ith C&
,& Compare and Contrast -a.a 5ith C;;&
5& EBplain Constru)tors 5ith eBamples&
0& EBplain the methods a.aila:le under String and String Buffer Class&
1& EBplain the Date Class methods 5ith eBamples&
2& Dis)uss in detail the a))ess spe)ifiers a.aila:le in -a.a&
3& EBplain the different .isi:ilit+ )ontrols and also )ompare 5ith ea)h of them&
%0& EBplain the different methods in ja.a&til&$rra+s )lass 5ith eBample&
%%& EBplain Pa)kages in detail&
%2& Dis)uss the methods under $rra+ Class&
%3& Dis)uss some of the )lasses a.aila:le under /ang pa)kage&
%,& "llustrate 5ith eBamplesC stati) and final&
%5& EBplain method o.erriding 5ith eBample program&
%0& 'hat is ja.aDo)* EBplain the )omments for )lasses> methods> fields and link&
%1& $ppli)ation Programs in -a.a&
!"# ""
P$R# $
%& Define "nheritan)e
2& 'hat are the t+pes of inheritan)e*
3& 4o5 is multiple inheritan)e a)hie.ed in ja.a*
,& 'hat is the use of super ke+5ord*
5& 'hat are o:je)t 5rappers* 6i.e eBample&
0& 'hat is "nheritan)e 4ierar)h+*
1& Differentiate o.erloading and o.erriding&
2& Define pol+morphism&
3& Differentiate stati) :inding and d+nami) :inding&
%0& 'hen 5ill a )lass :e de)lared as final*
%%& 'hen 5ill a method :e de)lared final*
%2& 'hat is an a:stra)t )lass*
%3& 'hat is the need for a:stra)t )lasses*
%,& EBplain a:out prote)ted .isi:ilit+ )ontrol&
%5& 'hat are the methods under Do:je)tD )lass < ja.a&lang&(:je)t&
%0& EBplain toString method of o:je)t )lass&
%1& 'hat is refle)tion*
%2& 'hat are the uses of refle)tion in -a.a&
%3& 4o5 5ill +ou )reate an instan)e of Class&
20& 'hat are the methods under refle)tion used to anal+Ae the )apa:ilities of )lasses*
2%& 4o5 to )reate arra+s d+nami)all+ using refle)tion pa)kage&
22& Define an interfa)e&
23& 'hat is the need for an interfa)e*
2,& 'hat are the properties of an interfa)e*
25& Differentiate $:stra)t )lasses and interfa)e&
20& 'hat is o:je)t )loning*
21& Differentiate )loning and )op+ing&
22& Differentiate shallo5 )op+ and deep )op+ in )loning&
23& Does "nheritan)e remo.es an+ fields<or methods of super )lass*
30& Eention the use of final ke+5ord&
3%& 'hat is nested )lass* Eention its t+pes&
32& 'hat is inner )lass*
33& 'hat is the need for inner )lasses*
3,& 'hat are the rules for inner )lass*
35& 'hat is lo)al inner )lass and anon+mous inner )lass* 6i.e their ad.antages&
30& 'rite the ad.antages and disad.antages of stati) nested )lass&
31& Define proBies&
32& 'rite the appli)ation of proBies&
33& 'hat are the properties of proB+ )lasses*
P$R# B
%& EBplain the )on)ept of inheritan)e and its t+pes&
2& EBplain the )on)ept of o.erriding 5ith eBamples&
3& 'hat is d+nami) :inding* EBplain 5ith eBample&
,& EBplain the uses of refle)tion 5ith eBamples&
5& Define an interfa)e& EBplain 5ith eBample&
0& EBplain the methods under Fo:je)tG )lass and F)lassG )lass&
1& 'hat is o:je)t )loning* EBplain deep )op+ and shallo5 )op+ 5ith eBamples&
2& EBplain stati) nested )lass and inner )lass 5ith eBamples&
3& 'ith an eBample eBplain proBies&
%0& De.elop a message a:stra)t )lass 5hi)h )ontains pla+Eessage a:stra)t
method& 'rite a different su:=)lasses like #eBtEessage> Hoi)eEessage and
IaBEessage )lasses for to implementing the pla+Eessage method&
%%& De.elop a a:stra)t Reser.ation )lass 5hi)h has Reser.e a:stra)t method&
"mplement the su:=)lasses like Reser.e#rain and Reser.eBus )lasses and
implement the same&
%2& De.elop an "nterest interfa)e 5hi)h )ontains simple"nterest and )omp"nterest
methods and stati) final field of Rate 25J& 'rite a )lass to implement those
methods&
%3& De.elop a /i:rar+ interfa)e 5hi)h has dra5:ook79> return:ook79 75ith fine9>
)he)kstatus79 and reser.e:ook79 methods& $ll the methods tagged 5ith pu:li)&
%,& De.elop an Emplo+ee )lass 5hi)h implements the Compara:le and Clonea:le
interfa)es& "mplement the sorting of persons 7:ased on name in alpha:eti)al9&
$lso implement the shallo5 )op+ 7for name and age9 and deep )op+ 7for
Date(f-oining9&
%5& EBplain the different methods supported in (:je)t )lass 5ith eBample&
%0& EBplain the methods supported in Class )lass&
%1& EBplain the Eethods supported in refle)t pa)kage& $lso 5rite a program to
implement the refle)tion of a parti)ular )lass details like )onstru)tors>
methods and fields 5ith its modifiers&
%2& De.elop a stati) "nner )lass )alled Pair 5hi)h has EinEaB method for finding
min and maB .alues from the arra+&
%3& 'hat is proB+ )lass* De.elop a )ode for )onstru)ting a proB+ o:je)ts to tra)e
a :inar+ sear)h method 5ith eBplanations&
!"# """
P$R# $
%& Dra5 the inheritan)e hierar)h+ for the frame and )omponent )lasses in $'# and
S5ing&
2& 'hat are the ad.antages of using s5ing o.er a5t*
3& 4o5 do a)hie.e spe)ial fonts for +our teBt* 6i.e eBample&
,& 6i.e the s+ntaB of dra5"mage79 and )op+$rea79 methods&
5& 'hat is $dapter )lass*
0& Dra5 the $'# e.ent 4ierar)h+&
1& 'hat are the s5ing )omponents*
2& 'hat are the methods under $)tion "nterfa)e&
3& 'hat are the methods under 'indo5/istener "nterfa)e&
%0& 'hat is the differen)e :et5een S5ing and $'#*
P$R# B
%& EBplain the )lasses under 2D shapes&
2& EBplain e.ent handling 5ith eBamples&
3& EBplain a)tion e.ent 5ith an eBample&
,& 'hat are the s5ing )omponents& EBplain&
5& Des)ri:e the $'# e.ent hierar)h+&
!"# "H
P$R# $
%& 'hat is generi) programming*
2& 'hat are Che)ked and nChe)ked EB)eption*
3& 'hat are )he)ked eB)eptions*
,& 'hat are runtime eB)eptions*
5& 'hat is the differen)e :et5een error and an eB)eption*
0& 'hat )lasses of eB)eptions ma+ :e )aught :+ a )at)h )lause*&
1& "f " 5ant an o:je)t of m+ )lass to :e thro5n as an eB)eption o:je)t> 5hat should "
do*
2& 4o5 to )reate )ustom eB)eptions*
3& 'hat are the different 5a+s to handle eB)eptions*
%0& 'hat is the purpose of the finall+ )lause of a tr+=)at)h=finall+ statement*
%%& 'hat is the :asi) differen)e :et5een the 2 approa)hes to eB)eption handling&
"s it ne)essar+ that ea)h tr+ :lo)k must :e follo5ed :+ a )at)h :lo)k*
%2& 4o5 does -a.a handle integer o.erflo5s and underflo5s*
P$R# B
%& EBplain generi) )lasses and methods&
2& EBplain eB)eption hierar)h+&
3& 'hat are the ad.antages of 6eneri) Programming*
,& EBplain the different 5a+s to handle eB)eptions&
5& 4o5 -a.a handle o.erflo5s and underflo5s*
!"# H
P$R# $
%& Des)ri:e s+n)hroniAation in respe)t to multithreading&
2& EBplain different 5a+ of using thread*
3& 'hat is s+n)hroniAation and 5h+ is it important*
,& 'hen a thread is )reated and started> 5hat is its initial state*
5& 'hat are s+n)hroniAed methods and s+n)hroniAed statements*
0& 'hat is daemon thread and 5hi)h method is used to )reate the daemon thread*
1& 'hat method must :e implemented :+ all threads*
2& 'hat kind of thread is the 6ar:age )olle)tor thread*
3& 'hat is a daemon thread*
%0& 'hat is a thread*
%%& 'hat is the algorithm used in #hread s)heduling*
%2& 'hat are the different le.el lo)kings using the s+n)hroniAation ke+5ord*
%3& 'hat are the 5a+s in 5hi)h +ou )an instantiate a thread*
%,& 'hat are the states of a thread*
%5& 'hat are the threads 5ill start> 5hen +ou start the ja.a program*
%0& 'hat are the different identifier states of a #hread*
%1& 'h+ do threads :lo)k on "<(*
%2& 'hat is s+n)hroniAation and 5h+ is it important*
P$R# B
%& EBplain the different states of a thread&
2& EBplain thread s+n)hroniAation 5ith eBamples&
3& EBplain the algorithm used for thread s)heduling&
,& Des)ri:e multi threading&
5& EBplain Deadlo)ks&