Edited Solution of Icse 2025
Edited Solution of Icse 2025
T25 861 2
(v)
Mouse Printer
Keyboard
Scanner
Barcode Scanner Microphone
Consider the Two dimensional array P[2]/3/, of peripherals (input / output
devices) given above, state the index of the device Barcode Scanner.
(a)P[1][]
(b) P[O][ 1]
(c) P[1J[2]
(d) P[O][O]
(vi) Which of the following is user defined data type?
1. array 3. class
2. double 4. boolean
(a) only 1
(b)1and 3
(c) only 2
(d) only 4
(d) errOr
given object creation statement?
(ix) Which of the following is true for the
Game cricket = new Game();
(a) public
(b) local
(c) protected
(d) private
(xi) Assertion (A): In switch case break statement avoids fall through.
Reason (R): break statement helps to execute only one case at a time.
(a)Both (A) and (R) are true and (R) is a correct explanation of (A).
(b) Both (A) and (R) are true and (R) is not a correct explanation of (A).
(c) (A) is true and (R) is false.
T25 861 4
(xii) A physical education teacher asks the students to do the side stretch as shown
below, 10 times. Which programming construct the teacher uses?
(a) if
(b) switch
(c)for
Side
(d) ifelse if Stretch
(xii) The index (subscript) of the last element of an array ar/ | is:
(a) ar.length( )
(b) ar[ ].length
(c) ar.length()-1
(d)ar.length-I
(xiv) Assertion (A): Aclock is a real-life example of nested loops.
Reason (R): The hour hand moves through 12 positions, while the minute
hand moves through 60 positions within each hour.
YBoth (A) and (R) are true and (R) is acorrect explanation of (A).
(b) Both (A) and (R) are true and (R) is not a correct explanation of (A).
(c) (A)is true and (R) is false.
(d) (A) is false and (R) is true.
(xv) Which of the following pairs of methods will cause a compile-time error due
to incorrect method overloading?
(a) void test(int a, int b) and void test(double a, double b)
(b) void test(int a, double b) and void test(double a, int b)
(c) void test(int a, double b) and void test(int a)
(d) oid test(int a) and int test(int a)
(b) Double.parse("2s")
(c) doutble.parseDouble("25")
(d) Double.parseDouble(25)
(xvii)
Consider the program segment:
int p=0;
for(p=4 :p>0;p- =2):
System.out.print(p);
System.out.println(p);
The above statements willdisplay:
(a) 42
(b) 4200
(c)
0
(d) 00
(xvii) System.out.println("I said,1"IA's wise to obey elders.\ "):
The output of the above statement is:
(a) Isaid,'It is wise to obey elders.'
T25 861
(xix) What is theoutput of the statement given
below?
"ANGER".compare To("ANGEL")
(a) 3
(b) 6
(c) 6
(d) 0
(xx) Consider the following program segment in which the statements are jumhled.
Choose the correct order of statements to calculate and return the factorial of 4.
for (k=1; k<-4; k+t)
return fa; 2 "
long fa 1, k; ’ 3,
fat=k; ’ 4
(a) 1,2, 3, 4
(b 3, 1, 4, 2
(c) 3, 1, 2, 4
(d) 1, 3, 2, 4
or
bt=a
bt=a;
b+t;
System.outprint(b);
(v)
dyste
Consider and give the output of the following program: [2]
class report
{ int a,b;
report)
{ a=10;
b=15;
report(int x, int y)
b=y;
void print0
( System.out.println(a *b);
T25 861 8
e g u )12)
(vi) (a) Name one String method which results in positive integer only.
(b) Name one String method which results in a character.
cone, the (2)
(vii) John was asked to write a Java code to calculate the surface area of a
following code was writen by him:
Surface area of cone is A=rl
class area