Java Programming Basics

Test your knowledge with some basic knowledge of Java
👁 438
statistics
calculate
Questions #: 8
Time:
Pass Score: 80.0%
Style
Mode

What is the correct statement to print "Hello World" (without double quotes)?

POINTS (1)

Correct Answer

Explanation

What is the result of the following calculation?

1 public class Main {
2 public static void main(String[] args) {
3 // Write your code here
4 int a = 3;
5 int b = 4;
6 int c = 5;
7 System.out.println(a + b * c + b);
8 }
9 }
POINTS (1)

Correct Answer

Explanation

What is the result of the following calculation?

public class Ex { 
public static void main(String[] args) {
System.out.println(5 + 15 / 3 * 2 - 8 % 3);
}
}
Missing
POINTS (1)

Correct Answer

Explanation

Is string concatenation using '+' allowed in Java?

POINTS (1)

Correct Answer

Explanation

What is the result of print statement in this Java program (+=)?

public class AssShortcutExample {
   public static void main(String args[]) {
      int num1 = 10;
      int num2 = 20;

      num2 += num1;
      System.out.println("= Output: "+num2);
}
}
Missing
POINTS (1)

Correct Answer

Explanation

What is the result of print statement in this Java program (-=)?

public class AssShortcutExample {
   public static void main(String args[]) {
      int num1 = 10;
      int num2 = 20;

      num2 -= num1;
      System.out.println("= Result: "+num2);
}
}
Missing
POINTS (1)

Correct Answer

Explanation

What is the difference between float and double data types in Java?

POINTS (1)

Correct Answer

Explanation

What is the difference between int and long in Java?

POINTS (1)

Correct Answer

Explanation

Views:
Trials:
Avg score:
0
sin cos tan
sin-1 cos-1 tan-1 π e
xy x3 x2 ex 10x
y√x 3√x √x ln log
( ) 1/x % n!
7 8 9 + MS
4 5 6 M+
1 2 3 × M-
0 . EXP ÷ MR
± RND C = MC

Document Actions