OOPJ 20MCA22 2023-June
OOPJ 20MCA22 2023-June
USN 20lvIC,{22
c,
1 a. Discuss the various primitive auru rr* le in java rvith suitable exi nrples. (10li{a:rks1
b. Write a Java program to periorm multiplication of tr.vo rnatrix using two;iintensionai ar':'a1'.
'o
O (10 Markst
o
Ui^,
OR
z 2 a. Discuss any five methods of StringBufibr cltrss r.vith applopriate example-s. (10 l\ilarksr
d9 b. Explain Else-if ladder and su,itch statement with its syntax and example. (10 Marksr
I I
-=!
'E+ Module-2
trr 3 a. Explain r.ariable-length argunrents in Jar-a rvith its syntar: and exarnple pr()gram. (10 hilarks)
OH
-qQ
b. Illustr':rte static variable. static nlethod and static block in -iava rvith an exa,nple. (10 Marksr
(]>
La
4 a. Describe abstract class anci alrstract ,rr.rf3[in java wrth ;t: syntar anci cxiiLripie. (10 iriar'ksj
b. Explain dynarnic method dispatch in java rvith an examp[c program. ( l0 lv,l a. rks t
Module-3
r'6 5a Describe lrou an interthce extu'nds one or m()re interfac.es rvith a sr.ritable exampie.
(10 Marks)
b. Write the follorving java program to create package and rrnport it in other iriograrn :
i) Create pa.kage callecj shape
o-;
!L ii) Define a class called Triaogle.jara in shape packagc. Triangle. jar,a sirould calcu.ete the
o'" area oltnangle.
oj
d6 iii) Coinpile and imporl shape Triangle in another class festPackagejava ('IcstPackaqc.java
9ts
aa class should be in another packaae test). (10lvlarkst
!0)
o.d
}.(F
boo OR
trbo
'nc
6=
6 a. Illustrate the use,of throw and thrcrws f..y*o,'4. in jar-a ri,ith exarnples. (10 hrarksl
E?.
b. Construct a java progmrn to irnplement a queue using user defined exceptio:r heuidline.
(10 Markst
o{
*N Modulc-4
o
7a. l)efine rnultithreading. Explarn thc nrechanism of- crea:ling thread using runn:ble interlace
rvith an example. (10 lvlla rksl
f b Construct a .lava program to create an enurureration day of week rr,ith seleu r.alues
SLIIDAY through SATURADY and add a method is to thc Da1.c,ftveel: ciasr;
'vorkday( ) 31
tliat retums tlue if the value on which it is called rs Monday througJr FRII)1r.Y. I:oi e>rrnlplc.
't
,i'i'::i,. lr
'I rll !r::l'
: !::i
2ONICA2z
interthread
b. Itrlustrate autoboxing and auto unboxing (10 Marks)
in expressions with an example
i*
(10 Marks)
10 a. Write a java
OR a$
which uses dat4gra1n socket to demonstrate client server
b. Define Write a simple Java pi&girarn to
-ll.',i,'
classes.
d::r
show workins of user o"*"f'#,1ll'l
(10 Marks)
;d
*ss./
e- n
*'&*#
d-b-$
'!.*Ld
d
r r* r- "
':&.{
.rit
.t
- "',,,.&,. ,,'
,.'J.
d***
nr+1
t
2 af}
,!:*4
,:*&,,.
fi.:::1"
i::::t*r. iE'.*:: "
:,
\:...1*:.4/
32