How to Use Subtraction Operator in Java


In this example we will show you how to use subtraction operator in Java.

Source Code

package com.beginner.examples;

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

Output:

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