Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
length()
size()
count()
amount()
What is the output of the following program?
public class Main {public static void main(String[] args) {int x = 5;int y = ++x * 2;System.out.println(y); }}
10
12
14
16
public class Main {public static void main(String[] args) {int[] arr = {1, 2, 3, 4, 5};for (int i = 0; i < arr.length; i++) {System.out.print(arr[i] + " "); } }}
1 2 3 4 5
5 4 3 2 1
1 3 5
2 4
if
for
switch
call
public class Main {public static void main(String[] args) {int x = 5;int y = 2;System.out.println(x + y); }}
2
3
5
7
final int var = 5;
int const var = 5;
const int var = 5;
int var = 5; final
*
++
&&
+
public class Main {public static void main(String[] args) {int x = 10;x++;System.out.println(x);}
11
Compilation error
int
float
string
char
char[] arr = {'a', 'b', 'c'};
char[] arr = new char[]{'a', 'b', 'c'};
char[] arr = new char[3]{'a', 'b', 'c'};
char[] arr = new char[3]; arr[0] = 'a'; arr[1] = 'b'; arr[2] = 'c';