/java_operators

Example Application: Operators

Primary LanguageJava

Java Operators

Example Application: Operators

Sum

		intValue = 0;
		intValue++;

		intValue = 0;
		intValue += 1;

		intValue = 0;
		intValue = intValue + 1;

output

	1

Subtraction

		intValue = 1;
		intValue--;

		intValue = 1;
		intValue -= 1;

		intValue = 1;
		intValue = intValue - 1;

output

	0

Multiplication

		intValue = 2;
		intValue *= 2;

		intValue = 2;
		intValue = intValue * 2;

output

	4

Division

		intValue = 2;
		intValue /= 2;

		intValue = 2;
		intValue = intValue / 2;

output

	1

Some links for more in depth learning