- The body of the if statement begins with
the opening brace, {, and ends with the closing brace,
}.
- These braces are required when the body contains more than 1
statement.
- Notice that in this case, no semi-colon is used to terminate the
statement.
- This is true generally in statements that end with a closing
brace.
- The getText method of TextField objects is used to
get the text from the text fields, which is returned as a
String.
- The syntax object.method is used to do this, in
this case being input1.getText().
- What arguments are passed to the getText method?
- The Integer.parseInt "method" converts this
String representation of an integer to its representation as an
int.
- The int representation is assigned to the int
variable (num1 or num2).