You are on page 1of 2

Computer Test Paper, class X,

Timing 35 minutes, M.Marks 40, Section A

1. Assertion (A) :Value of variable cannot be fixed


Reason (R ) : Variable’s value can be fixed by using final keyword.
a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of
Assertion (A)
b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of
Assertion (A)
c) Assertion (A) is true and Reason (R) is false
d) Assertion (A) is false and Reason (R) is true
2. Assertion (A): Call by value is known as pure method.
Reason (R): The original value of variable does not change as operation is performed on copied
values.
a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of
Assertion (A)
b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of
Assertion (A)
c) Assertion (A) is true and Reason (R) is false
d) Assertion (A) is false and Reason (R) is true
3. Alternative way to send multiple values from a function is:
a)Arrays b)List c)Tuples d)None
4. The expression which uses ! operator is known as
a)Relational b)Arithmetic c)Logical d)Conditional
5. The output of Math.round(6.4)+Math.ceil(-6.4) is
a)0 b)0.0 c)13 d)-12.0
6. The output of “Golden Jubilee”.substring(11):-
a)lee b)ilee c)ile d)none
7. System.out.println(Character.isUpperCase(‘4’));---output
a)A b)a c)4 d)none of these
8. An object said to be a ____ data
a)Non primitive b)basic c)primitive d)none
9. Division by a variable that contains a value zero is called ______error
a)Compile time b)runtime c)dsyntax )none
10. A ____function does not change or modify the state of their parameters received.
a)Pure b)impure c)actual d)none
11. What type of casting shown by the following examples?
double x=15.6;int n=(int)x;
a)Implicit b)Explicit c)both d)none

12. The ____ keyword refers to the current object


a)This b)this a)new d)that
13. Pre defined classes provided by java are called ____ classes
a)Library b)User Defined c)Compiler d)None
14. Automatic conversion from object of wrapper class to its primitive data type is called_____

a)Unboxing b)autoboxing c)implicit d)none

15. Instance variables are also known as ____

a)Static data members b) non static data members c)local variables d)none

16. Which of the following represent the second element of the second row in a multi
diamensional array?

a)arr[0][1] b)arr[0][0] c)arr[1][0] d)arr[1][1]

17. double a[]=new double[20]; total number of size in bytes of this array:-

a)20 b)100 c)160 d)200

18. Which of the following is the last subscript of N element array?

a)N b)N+1 c)N-1 d)None

19. System.out.println(“a”+10); output


a)a10 b)107 c)A10 d)a+10

20. Read the following text, and choose the correct answer:
A class encapsulate Data Members that contains the information necessary to represent the class
and Member methods that perform operations on the data member. What does a class
encapsulate?
a) Information and operation
b) Data members and Member methods
c) Data members and information
d) Member methods and operation

1. Write the expression :-


−b+ √ b 2−4 ac
2a
2. Find the value of x: where x=5
x* = ++x + x++ /3 - --x;
3. Define Array.
4. Convert into ternary
if(a>=4 && b==7)
c=a+b;
else
c=a-b;
5. Convert into switch
if(var==2)
System.out.println(“good”);
else if(var==4)
{System.out.println(“Better”);
System.out.println(“best”);
}
else
System.out.println(“Invalid”);
6. How many times will the following loop execute? What value will be returned?
int x = 2, y = 50;
do{
++x;
y -= x++;
}
while(x <= 10);
return y;
7. Write the output of the following String methods:
(a) "ARTIFICIAL".indexOf('I')+” ARTIFICIAL”.indexOf(‘a’);
(b) "JACK and Milly ".trim().length();
8. Output:-
String a = "20";
String b = "23";
double p = Double.parseDouble(a);
int q = Integer.parseInt(b);
System.out.print(a + "*" + b);

9. Consider the following string arry and give the output:-


String st[]={“Delhi”,”Mumbai”,”Lunknow”,”Dumka”};
System.out.println(st.length)
System.out.println(st[0].compareTo(st[3]));

10. int P[ ] = {12, 14, 16, 18};


int Q[ ] = {20, 22, 24};
Place all elements of P array and Q array in the array R one after the other.
(a) What will be the size of array R[ ] ?
(b) Write index position of first and last element?

You might also like