java program to add two number code example
Example 1: java sum of two numbers program intellij
public class AddTwoNumbers {
public static void main(String[] args) {
int num1 = 5, num2 = 15, sum;
sum = num1 + num2;
System.out.println("Sum of these numbers: "+sum);
}
}
Example 2: how to add integers in java
int a;
int b;
a+b = int c