diff --git a/source/ch4_conditionals.ptx b/source/ch4_conditionals.ptx index 0b32d00..91dd65a 100644 --- a/source/ch4_conditionals.ptx +++ b/source/ch4_conditionals.ptx @@ -13,20 +13,26 @@
- In Python the simple
score = 95
if score >= 90:
print("Excellent work!")
In Java, this same pattern requires two changes: the condition must be in parentheses
public class SimpleIfExample {
public static void main(String[] args) {
@@ -38,6 +44,8 @@ if score >= 90:
}
Once again you can see that in Java the curly braces define a block rather than indentation.
In Java, the parentheses around the condition are required because it is technically a function that evaluates to