Skip to content

Commit 9ce86e5

Browse files
myucesanjmrunkle
andauthored
Update introduction.md (exercism#2031)
* Update introduction.md Added examples and added more explanation on the operators. * Update introduction.md Merged with previous line per suggestion * Update java/concepts/booleans/introduction.md Added => mirroring the comments in the about.md * Update concepts/booleans/introduction.md Co-authored-by: Jason Runkle <jmrunkle@gmail.com> Co-authored-by: Jason Runkle <jmrunkle@gmail.com>
1 parent a2bbd64 commit 9ce86e5

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

concepts/booleans/introduction.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,19 @@
22

33
Booleans in Java are represented by the `boolean` type, which values can be either `true` or `false`.
44

5-
Java supports three boolean operators: `!` (NOT), `&&` (AND), and `||` (OR).
5+
Java supports three boolean operators:
6+
7+
- `!` (NOT): negates the boolean
8+
- `&&` (AND): takes two booleans and results in true if they're both true
9+
- `||` (OR): results in true if any of the two booleans is true
10+
11+
**Examples**
12+
13+
```java
14+
!true // => false
15+
!false // => true
16+
true && false // => false
17+
true && true // => true
18+
false || false // => false
19+
false || true // => true
20+
```

0 commit comments

Comments
 (0)