Exercise – Naming the statements
What are the following statements called?
i++;
String s;
s = "I am a string";
doSomething(1, "23");
Answer
The following statements are called:
- Increment statement:
i++;
- Variable declaration statement:
String s;
- Assignment statement:
s = "I am a string";
- Method invocation statement:
doSomething(1, "23");