Arihant - Computer Sample Paper 13 ICSE 2025
Arihant - Computer Sample Paper 13 ICSE 2025
G. publ ic static void main(String[] The above code has error in it,
args) {
(a) E, G, B, D, F, C, A identify it to produce the output
(b) E, G, B, F, D, C, A "UNKNOWN FLAVOR". Analysis
(c) E, G, B, D, C, E, A (iv) Write a java expression for
(d) E, G, B, D, E, C, A 10Wa-5/b [2]
(Xx) Assertion (A) Constructors in Java . Understanding
are special methods used to
(v) How many times below loop
initialize objects. " Application execute? [2]
Reason (R)Constructors have the for (int i = 0; i <5; it+)
same name as the class and do not
have a return type. System.out.println
(a) Both A and R are true, and R is the ("Iteration " + (1 t 1));
correct explanation of A.
(b) BothA and R are true, but R is not
the correct explanation of A.
What is the output? " Analysis
(c) A is true, but R is false. (vi) Write the output of the following
(d) A is false, but R is true. string methods: [2]
String x="pot", y="pet":
2. (i) What will be the output of the
(a) System.out.println
following statements? [2] (x.charAt (0)==y.charAt(0));
int a=3;
on le Toi (b) System.out.println
System. out. println(" "+(1+a));
System.out.println(" "+1+a): (x.charAt(1)==y.charAt(1) ):
. Understanding " Analysis
(ii) Evaluate the given expression when (vii) Predict the output of the following
the value of a=1 and b-6
ollet code snippet: [2]
[2] t char c h = ' V ' : l a e
a t= b++ *--a
char chr=Character
System.out.println ("a= "+a):
.toLowerCase(ch);
System.out.println ("b= "+b); int n=(int) chr-10;
o8 Analysis
System.out.println((char)
(iül) Consider the below code: [2] n+"\t"+chr);
String flavor = "CHOCOLATE": viii) Identi fy the error in
if (flavor. equals("VANI LLA")) the below code SP-13
public class Error
System.out.println
("VANILLA ICE CREAM" ); public static void
main(String[] args)
else if (flavor. equals
int num "Neha":
("STRAWBERRY">) System.out.println
("Number: " t num) ;
System.out.println
("STRAWBERRY ICE CREAM) "Analysis
else
(vii) Identify the error in the below code
[2]
public class Error
System.out.println
("UNKNOWN FLAVOR): public static void
main(String[] args)
126 i
Succeed Computer
int num "Neha":
Applica
("Creating employee
name + "
tions
System. out.println("Number: aged
+ nun); public static void
Answers
1. ()(6) (ii) (b) (ii) (a) (iv) (b) (v) (a)
(vi) (a) (vi) (a) (vii) (d) (ix) (c) (%) (a) For answers, scan
(xi) (a) (xii) (b) (xii) (a) (xiv) (a) (xv) (a) the givenQR code.
(xvi) (a) (xvii) (a) (xviil) (b) (xix) (d) (xx) (a)
SP-13