Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Java arithmetic is easy! 🧮

56.1K views on YouTube

#java #javatutorial #javacourse

public class Main {
public static void main(String[] args) {

// Arithmetic Operators

int x = 10;
int y = 2;
int z;

z = x + y; // ADDITION
z = x – y; // SUBTRACTION
z = x * y; // MULTIPLICATION
z = x / y; // DIVISION
z = x % y; // MODULUS

System.out.println(z);

}
}