0% found this document useful (0 votes)
55 views8 pages

Edited Solution of Icse 2025

The document consists of a series of multiple-choice questions related to Java programming concepts, including character classes, data types, loops, and method overloading. Each question provides four answer options, and the correct answers are to be selected without copying the questions. Additionally, there are programming tasks requiring Java expressions and object creation statements.

Uploaded by

callmevinodh9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views8 pages

Edited Solution of Icse 2025

The document consists of a series of multiple-choice questions related to Java programming concepts, including character classes, data types, loops, and method overloading. Each question provides four answer options, and the correct answers are to be selected without copying the questions. Additionally, there are programming tasks requiring Java expressions and object creation statements.

Uploaded by

callmevinodh9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

SECTIONA(40 Marks)

(Atempt oll quections from this Section )


Question 1
[20|
Choose the correct answers to the qcstions from the
given options.
(Do not copy the questions, write only the
correct answers)
() Character class methods are found in the package called.
(a) java util
(b java. lang
(c) java.awt
(d) java.io
(i)
System.out.printin('Z'+32); will display:
(a) z
(b) Z
(c 122
(d) 154

(üi) double x |/-{2.5,4.5,5.5,6.4}; occupies bytes.


(a) 16
(b) 4
(c) 8
(d)32
(iv) The output of 42/6%2 is:
(a) 1
(b) 10
(c) 2
(d) 0

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

(vii) Select the infinite loop:


(a) for(int i=1;i<=10;it+)
(b)for(int i=2; i!-0 ;i-3)
(c) for(int i=S ;i<=S;i++)
(d) for(int i=1;i>=1;i--)

T25 861 3 Turn Over


of Math.max(-7, Math. min(-5,-4)) is:
(vii) The output
(a)
(b) 4
(c) -7

(d) errOr
given object creation statement?
(ix) Which of the following is true for the
Game cricket = new Game();

(a) Game is an object of cricket class

(b) New keyword creates object Game


(c Game is a class and cricket is an object
(d) Game and cricket are objects

(x) Post office is an example for access specifier.

(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.

(d) (A) is false and (R) is true.

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)

T25 861 Turn Over


(xvi)
Which of the foilowing converts "25" to 25.0?
(a) Double.Parsedouble("25")

(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.'

(b)said, "It's wise to obey elders."


(c) Isaid,It's wise to elders.

(d) "It's 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

Question 2 Mah.t(P)* Maa.sr(o)


(i) Write thejava expression to find the product of square root of P and the square [2]
root of Q using the methods of Math class.
(ii) Write the output of the following String method: (2]
String x=talent" ; String y="matrix"; enti
System.out.print(z.substring(3).concat(y.substring(3) ;
Write the Java statement for creating an object named 'sifra' of the class (2]
(ii)
'Robot', which takes three double parameters.

T25 861 Turn Over

or

Robot sifra = new Robot(1.0,2.0,3.0);


(iv) Convert the given loop into exit controlled loop. [2]
int a,b;
for (a=10 ,b=l; a>=l ;a-=2) o

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);

static void main)


{ reportr= newreport);
rprint);
report p = new report(4, 5);
P.print0;

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

double area (double r, double h)


{ double l, a; Syntax error as l is not inilialized
a-22.0/7*r*l;
I=Math.sqrt(r*rth *h);
return a;

correct and write the


Specify the type of the error in the above program,
program to be error free.
[2]
(viii) Consider the following array and answer the questions given below:
int al | = {12, 10,8,4,6,2,3,5,7}
(a) What is the output of System.out.print(a/0]+a[5|D;?
0
(b) What is the index (subscript) of the largest element of the array a/ ?
(ix) (a) Write the Java statement to initialise the first 6 odd numbers in a 3x 2 array. [21
What is the result of x/0][1] + x/2]U]of the above array?
T3
(b) 5
(x) Give the output of the following program segmentiand specify how many timnes
the loop is executed.
0123
String s = JAVA"; JA vA JAVA
VA
for(i-0;i<s.length);it=2)
System.out.println(s.substring();
(ix) (a) int x[][]={{1,3},{5,7},{9,11}}; (b) 3 + 11 = 14

T25 861 9 Turn ver

You might also like