Contoh
package com.example;
public class Main {
public static void main(String[] args) {
// Operator Assigment berupa tanda (=)
// Assigment Operator jumlah
int a = 1;
a += 10;
System.out.println("Nilai a = " + a);
// Assigment Operator Pengurangan
int b = 100;
b -= 10;
System.out.println("Nilai b = " + b);
// Assigment Operator Pembagian
int c = 100;
c /= 10;
System.out.println("Nilai c = " + c);
// Assigment Operator Perkalian
int d = 100;
d *= 10;
System.out.println("Nilai d = " + d);
// Assigment Operator modulus
int e = 10;
e %= 7;
System.out.println("Nilai e = " + e);
}
}