Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
int[] arr = new int[5];
int arr[5] = {1, 2, 3, 4, 5};
int[] arr = {1, 2, 3, 4, 5};
int arr[] = new int[]{1, 2, 3, 4, 5};
What is the output of the following program?
public class Main {public static void main(String[] args) {int x = 10;x++;System.out.println(x);}
10
11
12
Compilation error
public class Main {public static void main(String[] args) {int x = 5;int y = ++x * 2;System.out.println(y); }}
14
16
public class Main {public static void main(String[] args) {int x = 5;int y = 2;System.out.println(x / y); }}
2.5
2
3
5
public class Main {public static void main(String[] args) {int x = 5;int y = 2;System.out.println(x > y || y < x); }}
1
0
Compile error
Runtime error
public class Main {public static void main(String[] args) {int x = 5;int y = 2;int z = x / y;System.out.println(z); }}
private
public
protected
global
public class Main {public static void main(String[] args) {String str = "Hello, world!";System.out.println(str.toUpperCase()); }}
HELLO, WORLD!
Hello, world!
hello, world!
hELLO, WORLD!
final int var = 5;
int const var = 5;
const int var = 5;
int var = 5; final
double var = 3.14159;
double var = 3,14159;
double var = "3.14159";
double var = Double.parseDouble("3.14159");