Mega Code Archive

 
Categories / Java Tutorial / Operators
 

Arithmetic Calculations

An assignment statement has three elements: the variable to store the result, the assignment operator: =, an arithmetic expression The statement is terminated by a semicolon. public class MainClass{   public static void main(String[] argv){      int a = 1;      int b = 2;      int c = 0;            c = a + b;            System.out.println(c);   } } 3