Java Programming Basics

Test your knowledge with some basic knowledge of Java

download Export
search_insights Statistics
stylus_note White Board
Quran
calculate Calculator
dictionary Dictionary
fullscreen Full Screen

QUESTION OF
Views #: 854
Questions #: 8
Pass Score: 80.0%
Style
Mode

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

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation

What is the result of the following calculation?

1 pts
volume_mute
public class Main {
  public static void main(String[] args) {
    // Write your code here
    int a = 3;
    int b = 4;
    int c = 5;
    System.out.println(a + b * c + b);
  }
}
note_alt Add notes
flag Flag

Correct Answer

Explanation

What is the result of the following calculation?

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

Correct Answer

Explanation

Is string concatenation using '+' allowed in Java?

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation

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

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

      num2 += num1;
      System.out.println("= Output: "+num2);
}
}
Missing
note_alt Add notes
flag Flag

Correct Answer

Explanation

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

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

      num2 -= num1;
      System.out.println("= Result: "+num2);
}
}
Missing
note_alt Add notes
flag Flag

Correct Answer

Explanation

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

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation

What is the difference between int and long in Java?

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation