Skip to content

Commit c304ca2

Browse files
authored
Merge branch 'develop' into develop
2 parents 6adaacc + b3ede81 commit c304ca2

31 files changed

+33
-35
lines changed

book.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title = "Modern Java"
33
description = "Book teaching how to write modern and effective Java."
44
authors = ["Ethan McCue", "Together Java", "Contributions from the Java Community"]
55
language = "en"
6-
multilingual = false
76

87
[output.html]
98
git-repository-url = "https://github.com/Together-Java/ModernJava"

src/arrays/challenges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Edit the following program so that the output is zero.
1313
void main() {
1414
// Only change this line
1515
String[] words = { "Sam", "I", "Am" };
16-
IO.println(array.length);
16+
IO.println(words.length);
1717
}
1818
```
1919

src/arrays/reassignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ IO.println(numbers.length);
2020
~}
2121
```
2222

23-
This reassignment will not be affect any variables which
23+
This reassignment will not affect any variables which
2424
are aliases for the variable's old value.
2525

2626
```java

src/arrays/relation_to_final_variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final char[] catchphrase = { 'w', 'o', 'a', 'h', '!' };
1212
IO.println(catchphrase);
1313

1414
// Cannot reassign
15-
// catchphrase = { 'e', 'g', 'a', 'd', 's' }
15+
// catchphrase = new char[] { 'e', 'g', 'a', 'd', 's' }
1616
// but can set elements directly
1717
catchphrase[0] = 'e';
1818
catchphrase[1] = 'g';
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Initializion with Size
1+
# Initialization with Size
22

33
The Nintendo GameBoy had a screen resolution of 160 x 144.
44
To store the value of each pixel[^bw] you would need an array 23,040 items
55
long.
66

77
To support this without you writing the word `false` 23,040 times,
8-
arrays can be made with just by giving a size and skipping the initializer.
8+
arrays can be made just by giving a size and skipping the initializer.
99

1010
```java,no_run
1111
boolean[] pixels = new boolean[23040];
@@ -14,4 +14,4 @@ boolean[] pixels = new boolean[23040];
1414
So you have to say `new` followed by the type of element in the array, `[`, the size of the array and `]`.
1515

1616

17-
[^bw]: The original GameBoy wasn't actually just black and white. It supported 7 shades of gray, so a `boolean` wouldn't technically to be enough to represent a pixel's state. You'd have to use something with at least 8 states, not just 2.
17+
[^bw]: The original GameBoy wasn't actually just black and white. It supported 7 shades of gray, so a `boolean` wouldn't technically be enough to represent a pixel's state. You'd have to use something with at least 8 states, not just 2.

src/boolean/or.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ walking the dog looks nice.
2020

2121
## Exclusive vs. Inclusive
2222

23-
It is important too note that this is not an "exclusive" OR.
23+
It is important to note that this is not an "exclusive" OR.
2424

2525
An exclusive OR would be something like
2626
a child being allowed to have ice cream _or_ a cookie, but not both.

src/boxed_primitives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void main() {
2424
}
2525
```
2626

27-
We call these primitives which might be null "Boxed Primitives" because you they are made by taking
27+
We call these primitives which might be null "Boxed Primitives" because they are made by taking
2828
the underlying thing and putting it in a "box."[^boxing]
2929

3030

src/boxed_primitives/boolean.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ The type to use for a `boolean` that might be null is `Boolean`.
88
Boolean b = null;
99
IO.println(b);
1010
b = true;
11-
IO.println(true);
11+
IO.println(b);
1212
~}

src/boxed_primitives/challenges.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void main() {
2828

2929
## Challenge 2.
3030

31-
Write a method which takes in a `Integer[]` representing
31+
Write a method which takes in an `Integer[]` representing
3232
a series of distances and prints out every distance
3333
followed by ` kilometers`.
3434

@@ -50,7 +50,7 @@ void printDistances(Integer[] distances) {
5050
}
5151
5252
void main() {
53-
printNames(new String[] {
53+
printDistances(new Integer[] {
5454
45,
5555
99,
5656
23

src/boxed_primitives/character.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ IO.println(c);
1111
~}
1212
```
1313

14-
Unlike a `char[]`, a `Character[]` will not be have its contents
14+
Unlike a `char[]`, a `Character[]` will not have its contents
1515
shown when printed.
1616

1717
```java

0 commit comments

Comments
 (0)