You are on page 1of 2

ANNEXURE-1

Standard Template for Academic Tasks (22231)

1 2 3 4 5

Faculty UID-26121 Faculty name:- Dr. Om Prakash Yadav


Academic Task Number: Test-1 Course code: CSE310
Date of allotment: 5-02-2023 Course title: Programming in Java
Date of submission: 18-02-2023 Maximum Marks: 30(10 MCQ + 20 Code)
Academic Task Type: MCQ and Code Based Test Section:- K21GR

Registration No: _________________ Name: _________________________


Question Question Statement Course Bloom’s Marks per
Number Outcome level Question
1 What will be the output of the following code snippet? CO2 L2: 2
String [] [] arr = new String [3][2]; //L1 Understand
arr[1] = new String [2];
arr[2] = new String [] {"A", "B"}; //L2
arr[0] = new String []{"X", "Y", "Z"};
System.out.println(arr[1][1] + arr[2][2]);
A. Runtime Error B. Compilation Error in L1
C. NullZ D. Compilation Error in L2
2 What will be the output of the following code snippet? CO 1 L4 Analyze 2
public static void main (String [] rk) {
one:
for(int i = 3; i > 0; i--)
{
for(int j = 0; j < 2; j++)
{
if( j > i) break;
if(i == j) continue one;
System.out.print(j);
}
System.out.print(i);
}
}

A. 01301201 B. 012010
C. 013012 D. 0130120

3 Identify the Incorrect statement(s). CO 2 L4: Analyze 2


byte b = 65; //i
char c = b; //ii
c += 2; //iii
int x = c; //iv
x = (short) b; //v
A. ii & iii B. ii & iv

Page 1 of 2
ANNEXURE-1
Standard Template for Academic Tasks (22231)

C. Only ii D. ii, iv & v


4 What will be the output of the following program ? CO 2 L1: 2
class Demo { Understand
public static void main(String args[]) {
int a=5;
a+=6;
switch(a-1) {
case 5:
System.out.println("10");
break;
case 10:
System.out.print("15");
System.out.print(((a%2==0)?"-even-":"-odd-"));
default:
System.out.print(a%2);
}
}
}
A. 15-even-1
B. 15-even-0
C. 15-odd-1
D. 15-odd-0

5 Consider the following program and identify the output CO 2 L4: Analyze 2
class Demo {
public static void main(String args[]) {
short x=10;
x=x*5;
System.out.print(x);
}
}
A. 50
B. 10
C. 0
D. Compilation error

Page 2 of 2

You might also like