3. 4. 1. 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 |