How to Use Decrement Operator in Java


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

Source Code

package com.beginner.examples;

public class DecrementOperator {
  public static void main(String[] args) {
    int i = 16;
    --i; // use decrement operator
    System.out.println(i);
  }
}

Output:

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