In this example we will show you how to use increment operator in Java.
Source Code
package com.beginner.examples;
public class IncrementOperator {
public static void main(String[] args) {
int i = 3;
++i; // use increment operator
System.out.println(i);
}
}
Output:
4