basic code in java code example
Example 1: basic java coding
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 CODE JAVA???????????
int[] marks = {50, 55, 60, 70, 80}; System.out.println(marks[0]);// Output: 50 System.out.println(marks[4]);// Output: 80