Class 10 ICSE Practice Paper 2
Class 10 ICSE Practice Paper 2
1) System.out.println(“a”+0+’A’);
1) a0A b) a065 c) a65 d) a4564
2) System.out.println(“B”+”a”);
System.out.println(‘B’+’a’);
a) Ba b) Ba c) Ba d) 163
Ba 6697 163 Ba
3) System.out.println(‘A’+’1’+“B”);
a) A1B b) A49B c) 651B d) 114B
4) System.out.print(‘A’+’1’);
a) A1 b) 651 c) 6549 d) 114
5) System.out.println(‘B’+9+’z’);
a) B9z b) 669122 c) 245 d) 197
6) System.out.println(“ADD”+(‘A’+’B’));
a) ADDAB b) ADD6566 c) ADD131 d) ADDA+B
7) String n=”210”;
n=n+’A’;
System.out.println(n);
System.out.println(Integer.parseInt(n)+20));
a) 210A b) 210A c) 21065 d) 210A
21020 230 230 Error
16) Which operation will be performed first in the given expression: ++x / b+c * d % e
a) ++ b) + c) * d) %
23) Given the following method prototype: int Change(int p, int q);
The statement to call the method is:
a) Change(10,20); b) s = Change(10,20); c) Change(4.5,5.6); d)s=Change(4.5,5.5);
25) The prototype of a function Show(), that returns a float and takes two integer arguments is:
a) void Show(int a,int b) b) float Show(int a, int b) c) float Show(int a) d) static Show(int a,int b)
26) Fill in the blanks to import all the classes of the package “Education”,
import Education.____;
a) # b) all c) * d) **
27) What is the output produced by the following lines of program code?
char x,z;
int y;
x = 'A';
y = ++x;
z = (char)y;
System.out.println(x+"\t"+y+"\t"+z);
a) B 66 B b) A 66 B c) A 65 B d) Error
30) if ( n > m)
System.out.print(“GOOD”);
System.out.print(“LUCK”);
else
System.out.print(“DONE”);
What will be the output if n=6 and m=4?
a) GOOD b) GOODLUCK c) DONE d) Error
31) System.out.println(Math.ceil(-9.4)+Math.sqrt(9.0));
a) 6.0 b) -6.0 c) -5.0 d) 5.0
32) Which of the following statements is not true about a static method?
a) It can be invoked without creating an object.
b) It can be called by a non-static method.
c) It can access instance variables directly.
d) It can access static variables directly.
33) To successfully overload a method in Java, the return types must be ___.
a) Same
b) Different
c) Same but using superclass or subclass types also work
d) None
34) What is the output of the below Java program with multiple methods?
public class MethodOverloading1
{
void show(int a, char b)
{
System.out.println("KING KONG");
}
38) The condition of an IF statement evaluates to boolean only if the expression contains?
a) logical operators
b) relational operators
c) boolean operands
d) All
40) An IF-ELSE statement is better than a SWITCH statement in which scenario below?
a) Checking for More-than condition
b) Checking for Less-than condition
d) Checking for Ranges
d) All
43) What is the output of the below Java program with a SWITCH statement?
int points=6;
switch(points)
{
case 6: ;
case 7: System.out.println("PASS");break;
case 8: ;
case 9: System.out.println("Excellent");break;
case 10: System.out.println("Outstanding"); break;
default: System.out.println("FAIL");
}
a) PASS
b) Excellent
c) Outstanding
d) FAIL
47) What is the output of the Java code snippet with Ternary operator?
int num = false?10:20;
System.out.println(num);
A) 10
B) 20
C) 0
D) Compiler error
48) What are the types of data that can be used along with Relational operators in Java?
a) char, boolean, Object
b) byte, short, int, long
c) float, double
d) All the above