Skip to content

Commit

Permalink
Fix nullability explanation (#2856)
Browse files Browse the repository at this point in the history
This change fixes the grammar and updates in the nullability concept and related exercise to improve consistency.

Co-authored-by: Kah Goh <[email protected]>
  • Loading branch information
armanh3k and kahgoh authored Nov 8, 2024
1 parent b7505e4 commit 3369915
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions concepts/nullability/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

In Java, the [`null` literal][null-keyword] is used to denote the absence of a value.

[Primitive variables][primitive-data-types] in java all have a default value and therefore can never be `null`.
[Primitive data types][primitive-data-types] in Java all have a default value and therefore can never be `null`.
By convention, they start with a lowercase letter e.g `int`.

[Reference variables][reference-data-types] contain the memory address of an object and can have a value of null.
These variables usually start with an uppercase e.g `String`.
[Reference types][reference-data-types] contain the memory address of an object and can have a value of `null`.
They generally start with an uppercase letter, e.g. `String`.

Attempting to assign a primitive variable a value of `null` will result in a compile time error as the variable always holds a default value of the type assigned.

Expand Down
6 changes: 3 additions & 3 deletions concepts/nullability/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

In Java, the `null` literal is used to denote the absence of a value.

Primitive data types in java all have a default value and therefore can never be `null`.
Primitive data types in Java all have a default value and therefore can never be `null`.
By convention, they start with a lowercase letter e.g `int`.

Reference types contain the memory address of an object can have a value of null.
These variables usually start with an uppercase e.g `String`.
Reference types contain the memory address of an object and can have a value of `null`.
They generally start with an uppercase letter, e.g. `String`.

Attempting to assign a primitive variable a value of `null` will result in a compile time error as the variable always holds a primitive value of the type assigned.

Expand Down
6 changes: 3 additions & 3 deletions exercises/concept/tim-from-marketing/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

In Java, the `null` literal is used to denote the absence of a value.

Primitive data types in java all have a default value and therefore can never be `null`.
Primitive data types in Java all have a default value and therefore can never be `null`.
By convention, they start with a lowercase letter e.g `int`.

Reference types contain the memory address of an object can have a value of null.
These variables usually start with an uppercase e.g `String`.
Reference types contain the memory address of an object and can have a value of `null`.
They generally start with an uppercase letter, e.g. `String`.

Attempting to assign a primitive variable a value of `null` will result in a compile time error as the variable always holds a primitive value of the type assigned.

Expand Down

0 comments on commit 3369915

Please sign in to comment.