Skip to content

Instantly share code, notes, and snippets.

@rmg007
Created October 3, 2022 21:12
Show Gist options
  • Save rmg007/8620d9c36482bd9f487fddef9566ecd3 to your computer and use it in GitHub Desktop.
Save rmg007/8620d9c36482bd9f487fddef9566ecd3 to your computer and use it in GitHub Desktop.
learn and dive deep Java Course. Assignment Operators lecture
public class Main {
/*
= , +=, -=, /=, *=
*/
public static void main(String[] args) {
int x = 6;
x += 2; // x = x + 2;
System.out.println(x);
int n = 6;
n /= 2; // n = n / 2
System.out.println(n);
int a = 2;
a *= 2; // a = a * 2;
System.out.println(a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment