MAHARAJA AGRASEN INSTITUTE OF TECHNOLOGY
MA IT
nGfi~
liiiqfflt " ""''-'~
Asslgnment#t
Year of Study: 2024-25
Name of Subject:· Programming in Java
Subject Code: CIC-212
Semester: 4
Class: 4ITE
Name: UjiuoJ S~J
Enrolment No.: 2.031Lt.B \3\2-3
Group: , 't ~ Lt
Assignment Date Given Date of Mode of Total co
No Submission Submission Marks Mapped
1 31-01-2025 10-02-2025 Hard Copy 15 CO1,CO2
Questions:
Q.No.1: Write your views on "Apart from being an interpreter JVM is an emulator".
Marks:2, CO1
Q. No. 2: Explain the use of wrapper Classes? Marks:2, CO2
Q. No. 3: Why String objects are considered to be immutable? Marks: 2, CO2
Q. No. 4: Why the mainQ method is declared as 'static'? Marks:2, CO1
Q. No. 5: What is the difference between private, default, protected and public access specifiers?
Marks:2, CO2
Q. No. 6: Why 'new' keyword is not used while defining the primitive data types?
Marks:2, CO1
Q. No. 7: Determine the output: Marks:3, CO2
(I) class Test
{
public static void main(StringO args)
{
new TestQ.mainQ;
}
public void mainO
{
System.out.println(" Hello World");
}
(ii) class Compare
{
public static void main(String□ args)
System.outprintln("1<2<3 is::" + (1&1t;2&1t;3));
System.outprintln("1>2>3 is::" + (1>2>3));
(iii) class C
{
public static int mem=l;
static {
System.outprintln("Inside sinit of C');
}
class Init
{
public static void main(StringO args)
{
System.outprintln("C.mem =" + C.mem);
}
Assi~nme.nL- i
bo.fh -.r, fnio-prJ(4 a.11rl a. r1 tff 1~ ,
1• 1lie. :r\JM c~n be. CtJru1'tlot.\.~
s "'" in ~ f "t~ J .·~ fr- .ns \~ J"°' " "- ~ jkU > ole . In ~ ref
rt1 ~ t.Nne. - t:. 'c eek_
'tJ_j J ~ v-._ rro j't'" m .s 1,, be r l-..1f-,<rr, ,·nJ. (r Jenl . 'A dti, ~~
_.J ""'-nkme , oll.o.o .J vlH>nmt, ~ s. fr tl~
1J a.Jc- ~n '-m ..J ~ b.J CJ .t~ n ~ Cll. ~,' "'~ en
.S. J en"
1
-b I \ 1>_\ JI\V
4
f roJ""" rt1~
I,.,_ ,l-.!>0-\ e O.f\ ,l O rt.t Jvt ._j .S_j-1tem .it et ouJ ..tC
~ 'tl t-1. f!(l➔ r ""'1 .,-t rrl l w;Ji; () J ~. -rc.d
~ \"b .n' ce n. t~ )J I\C .( C>~
JJin j J Je rn ho.J..d.t-04.{c
•n h... o..di fl n ,.o ,~ Hie c.tnd.f.\. / j s
" • ~ ~J... k een,,. t.J rr,•m
;h've_ cl.do.
Ant l. ~Y'Ylf"f;-'- c.\ ~c . ,'n Jo. o.. 0--lc
e.lC cl-us.es. a.At. f""'f
.t
~ ·el s. 7Ji
ti es (Uke. m l, c.hlA.l I d-o u..bk I c-k -) ,n ev
rnt #io J_~ ,h:, ftl qn it~ Ve ~
r .. ck ,c o.n J ,,~ ov ,•Jc
~- fk e J'o..v-
r.,
...t ...nj
v~ e ,S Q.,J O ~ ·c ,h. • Po 1- e
n,j .Ji· Vt;
">(<tr1'1f le. I J,, f-eJ et I ncl IF.
do uY e ~ d.oe4blc ~n J... c.ha.J.Ac
lt.A. f-' a h,u,. •
c t.01 \srJ.~c A r~ ~~ bl t be ou .tt c, erte.. Cl ~~
Atis...3. J'l rln j
I1 u f',J-~J ,
~~
,h
fec ~1
..~e ..
ll>-
.C"1! "of be. c""'n~c.& • An~ rt11, '1f'--" ., .,
k o..
sk ~ .,,es..JJ. c . tn ~'- u.e d> 'on o.1nee.a b, ·n o~ ~J ,_ Je~"•~J
1
°'"'.j ,'n .J. l\n ch 4nj eel • iii\ ·~ i '11 rn ~ b:I; ~ (Jll '-l.U .S r ec "'""-~ 1
-fh c. n~ .)~
t)r-fi'm12Ah'c,r, (-t.._c.h C\J
~ tl ~ ~ j- ~ ,nJ. r'+ m qn ce .
\ t1 1-un I iJ • .
-HtJ ff
~s lt ... 1n (.. f\'ICUoC) tndf..oil ~ dec
°'n be.
i- t'"
l~eof. a.t .dJ i'c . t.e
r"nJhime
:r -kmc tAt#i.o .J (A( .J,' 11 j Qn
"ok.<. m«l.l n O Ir> ~
- c:J lld. b -fftt. ,vo.. .R,l(.n
.c.. l'\~ 1. ~ .Jtnc e.. -Hu . ~v M ne. ( d.J -/f, ,•n
i+ .sl. J,' c. ,JJ ,01 .0 if b b. ~cce.s..1eJ,
~ r-- 1, ff1o .\4n.l
rt H '111~ fo i ri .1 -f.. ti-h"-l , b.
~r "'7
oll1...c: d-\.1 f orf) il-\ c. c ku I..O Ith •"1--
•
~ f ~---
fl\b\lc ~ rnen1b ~i -~cc~blc. om ctn~ 6#1 t-\ c~.u, ,_~t¼.J.ic.s~
1 rc~e •
• .• ·, \l .
I t I \ I .
' I J / ' ' .
t-te.llo · ~ orfcl. ., -.
) / f ")
' , •• !' r,,
f
I .
.l .'
crn. . ,<: 2.L..3
I .
,·s. : : 4-ru.c.
I·;2..; ~ ~ t'l : 4:, • f~\t~
(. '
I ' '
• I
Q'ii) Jnslclc ~'c ~n\¼ c,/- C.
C. e n1eJT1 = i, •
' '
' I
.'. (
\. )
.
,I ' '
'• I ,
.' I
\
I
I