Question 02 of 05

Add Two Numbers

Write a Java program to add two numbers and display the result.

C++
public class AddNumbers {
    public static void main(String[] args) {
        int a = 10, b = 20;
        int sum = a + b;
        System.out.println("Sum: " + sum);
    }
}
Question 2 of 5