MCQ Presentation
MCQ Presentation
MCQ Presentation
UNIT - II
20BCA013 Harsh Kukadiya
1. JAVA identifiers are case sensitive or not?
True False
1. JAVA identifiers are case sensitive or not?
True False
2. Which one is not a keyword in Java?
a) synchronized
b) Assert
c) export
d) volatile
2. Which one is not a keyword in Java?
a) synchronized
b) Assert
c) export
d) volatile
3. Range of short is _______?
a) -128 to 127
b) -215 to 215 -1
c) -217 to 217 -1
d) -125 to 124
3. Range of short is _______?
a) -128 to 127
b) -215 to 215 -1
c) -217 to 217 -1
d) -125 to 124
4) What is the output of the below Java code?
int a = 2 - - 7;
System.out.println(a);
a) 9
b) error
c) 10
d) -5
4) What is the output of the below Java code?
int a = 2 - - 7;
System.out.println(a);
a) 9
b) error
c) 10
d) -5
5) What is the output of the Java code snippet?
int a=5, b=10, c=15;
a -= 3;
b *= 2;
c /= 5;
System.out.println(a +" " + b + " " + c);
A) 2 20 3
B) 2 20 5
C) 2 10 5
D) -2 20 3
5) What is the output of the Java code snippet?
int a=5, b=10, c=15;
a -= 3;
b *= 2;
c /= 5;
System.out.println(a +" " + b + " " + c);
A) 2 20 3
B) 2 20 5
C) 2 10 5
D) -2 20 3
6) Arithmetic operators +, -, /, * and % have
which Associativity?
a) Right to Left
b) Left to Right
c) Right to Right
d) Left to Left
6) Arithmetic operators +, -, /, * and % have
which Associativity?
a) Right to Left
b) Left to Right
c) Right to Right
d) Left to Left
7) What is the output of the Java code snippet?
int a=10, b=5, c=3; int d = a+c/2*b;
System.out.println(d);
a) 30
b) 15
c) 32.5
d) 17.5
7) What is the output of the Java code snippet?
int a=10, b=5, c=3; int d = a+c/2*b;
System.out.println(d);
a) 30
b) 15
c) 32.5
d) 17.5
8) What is the output of the below Java program?
a) 2,65
b) 3,95
c) 3,65
d) Compiler error
8) What is the output of the below Java program?
a) 2,65
b) 3,95
c) 3,65
d) Compiler error
9) What is the output of Java program?
a) RED
b) YELLOW
c) WHITE
d) Compiler error
9) What is the output of Java program?
a) RED
b) YELLOW
c) WHITE
d) Compiler error Array elements must be separated
with Comma(,)s.
10) What will length() return?
a) Size of array
b) No of character
c) Character of array
10) What will length() return?
a) Size of array
b) No of character
c) Character of array
11) What will be the output of the following Java code?
c) A d) B
A A
11) What will be the output of the following Java code?
c) A d) B
A A
12) Which code line could possibly "call" this
method?
public static int SomeMethod(double[ ] array,
int[ ] number)
{...
}
a) 6.5 9.5
b) 12.5
c) 16
d) 6.5 9.5
13) What is the output of the following code fragment?
double [ ] x = new double [ 4];
x[0] = 8.5;
x[1] = 6.5;
x[2] = 9.5;
x[3] = 12.5;
System.out.println(x[1 + 2]);
a) 6.5 9.5
b) 12.5
c) 16
d) 6.5 9.5
14) What will be the output?
a) 54
b) 2 10
c) 44 6
d) 44 10
14) What will be the output?
a) 54
b) 2 10
c) 44 6
d) 44 10
15) Which of these is an incorrect array
declaration?