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 #: 773
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
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 }
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