You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/branching_logic/if.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,3 +38,14 @@ if (age < 25) {
38
38
39
39
If this condition evaluates to `false`, then the code inside of `{` and `}`
40
40
will not run.
41
+
42
+
NOTE: If you have only one statement, you do not need to put code inside of `{` and `}`. Moreover, the remaining lines will not be considered part of the if block.
43
+
44
+
```java
45
+
~void main() {
46
+
int age =20;
47
+
if (age <25)
48
+
IO.println("You are too young to rent a car!"); // If condition evaluates to true
0 commit comments