Font size
WorksheetsJava syntax
Total questions: 86
Worksheet time: 29mins
What is the output of the following code?
System.out.println(3 + 5 / 2);
(a)
What is the output of this code?
System.out.println("Java " + "Programming");
(a)
Predict the output:
int x = 10; System.out.println(x * 2);
(a)
What will this print?
int x = 5; int y = 3; System.out.println(x - y);
(a)
Enter the output:
System.out.println(10 / 4);
(a)
What is the output of the following code?
System.out.println(2 + "2");
(a)
Enter the output of this loop:
for(int i = 1; i <= 3; i++) { System.out.print(i); }
(a)
What is the output?
System.out.println("Value: " + (4 * 5));
(a)
Predict the output:
boolean flag = true; System.out.println(!flag);
(a)
What is printed by this code?
System.out.println(10 % 3);
(a)
What is the output of the following code?
System.out.println(3 + 5 % 2);
(a)
