Skip to content

Commit beafad8

Browse files
committed
...
1 parent d7941e7 commit beafad8

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
# Data Types III
192192

193193
- [null](./null.md)
194+
- [Null as Absence](./null/null_as_absence.md)
194195
- [Checking for null](./null/checking_for_null.md)
195196
- [Field Access](./null/field_access.md)
196197
- [Instance Methods](./null/instance_methods.md)

src/null.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,4 @@ void main() {
2121
}
2222
```
2323

24-
When something has the value of `null` it represents the absence of a "legitimate" value.
25-
26-
A good example is when a puppy is born. It starts without a name and it is later given a name.
27-
`null` is a way to represent the state of the world in the time before it is named.
28-
29-
```java
30-
void main() {
31-
// Just born, it has no name
32-
String puppyName = null;
33-
System.out.println("At the start, the name is " + puppyName);
34-
35-
puppyName = "Sally";
36-
System.out.println("Later it was given the name " + puppyName);
37-
}
38-
```
39-
4024
[^aswellas]: As well as `long`, `short`, `byte`, and `float` but I haven't shown you those yet.

src/null/null_as_absence.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Null as Absence
2+
3+
One way to use `null` is to have it be a stand in for when there is
4+
an "absence" of a value.
5+
6+
Consider [Cher](https://en.wikipedia.org/wiki/Cher). Unlike most people,
7+
Cher does not have a last name.
8+
9+
```java
10+
```

0 commit comments

Comments
 (0)