How to Use Addition Operator in Java


In this example we will show the method to use addition operator in Java.

Source Code

package com.beginner.examples;

public class AdditionOperator {
  public static void main(String[] args) {
    int a = 5;
    int b = 3;
    System.out.println(a + b); // use addition operator
  }
}

Output:

8
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments