Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
int[] numbers = {1, 2, 3};
int numbers[] = {1, 2, 3};
int numbers = {1, 2, 3};
Both A and B
public
private
protected
static
What is the output of the following code?
public class Test { public static void main(String args[]) { int x = 10; int y = 5; if(x > y) { System.out.println("x is greater than y"); } else { System.out.println("x is less than or equal to y"); } } }
x is greater than y
x is less than or equal to y
Both statements are printed
No output
public class Test { public static void main(String args[]) { int x = 10; int y = 20; System.out.println(x < y && x > 5); } }
1
0
while
for
do-while
if
switch
try
public class Test { public static void main(String args[]) { int x = 5; System.out.println(x++); } }
4
5
6
7
Single
Multiple
Hierarchical
Hybrid
public class Test { public static void main(String args[]) { for(int i = 0; i < 5; i++) { System.out.println(i); } } }
0 1 2 3 4
1 2 3 4 5
0 1 2 3 4 5
Infinite loop
int
boolean
double
string