From ac746362008ddba0ca227aceabd669be9c60112e Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Tue, 16 Sep 2025 19:31:23 -0400 Subject: [PATCH 01/13] Footnotes --- src/niche_numerics/byte.md | 6 ++++++ src/reflection/invoke_a_method.md | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/niche_numerics/byte.md b/src/niche_numerics/byte.md index 2d2ea01..1468911 100644 --- a/src/niche_numerics/byte.md +++ b/src/niche_numerics/byte.md @@ -53,6 +53,12 @@ IO.println(b); You will most often use the `byte` type when working with data as sequences of bytes, such as reading from and writing to binary files. Representing binary data as arrays of `byte` values is more memory-efficient than representing each individual byte as, say, an `int`. + + + ```java,no_run // This array of 4 bytes byte[] bytes = { 1, 2, 3, 4 }; diff --git a/src/reflection/invoke_a_method.md b/src/reflection/invoke_a_method.md index 601dbd7..975e133 100644 --- a/src/reflection/invoke_a_method.md +++ b/src/reflection/invoke_a_method.md @@ -37,7 +37,7 @@ class Tea { ``` For static methods you do not need an instance of the class to invoke them. -Instead, the first argument is ignored. You can pass `null`. +Instead, the first argument is ignored. You can pass `null`[^strange]. ```java import java.lang.reflect.InvocationTargetException; @@ -65,4 +65,6 @@ class Apple { IO.println("You took " + times + " bite" + (times < 1 ? "." : "s.")); } } -``` \ No newline at end of file +``` + +[^strange]: I find this strange. It hurts my brain. \ No newline at end of file From 63bab3ae04821b22f613f2b13f757d6960f615bc Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Tue, 16 Sep 2025 19:57:13 -0400 Subject: [PATCH 02/13] Locales --- src/strings_ii/UPPERCASE.md | 14 +++++++++++++- src/strings_ii/lowercase.md | 18 ++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/strings_ii/UPPERCASE.md b/src/strings_ii/UPPERCASE.md index 870e39e..07f518a 100644 --- a/src/strings_ii/UPPERCASE.md +++ b/src/strings_ii/UPPERCASE.md @@ -12,4 +12,16 @@ void main() { } ``` -This does not change the original `String` in place. It just makes a new `String` with all upper-case letters. \ No newline at end of file +This does not change the original `String` in place. It just makes a new `String` with all upper-case letters. + +Much like with `.toLowerCase()` you can optionally provide a `Locale` to get consistent behavior +no matter what language the system is set to. + +```java +void main() { + String message = "Happy Valentines Day"; + + String upperCased = message.toUpperCase(Locale.US); + IO.println(upperCased); +} +``` \ No newline at end of file diff --git a/src/strings_ii/lowercase.md b/src/strings_ii/lowercase.md index 3bb24a4..6bf6789 100644 --- a/src/strings_ii/lowercase.md +++ b/src/strings_ii/lowercase.md @@ -16,7 +16,7 @@ void main() { This does not change the original `String` in place. It just makes a new `String` with all lower-case letters. -What about other languages? Many of them also have a distinction between uppercase and lowercase, and usually, `.toLowerCase()` does the right thing for them too: +Many other languages also have a distinction between upper-case and lower-case and, usually, `.toLowerCase()` does the "right thing" for them too: ```java ~void main() { @@ -25,4 +25,18 @@ IO.println("ПРИВЕТ".toLowerCase()); // prints "привет" ~} ``` -However, in different languages, the mapping between uppercase and lowercase characters can differ. For example, in Turkish, the lowercase form of the letter `I` is `ı` without a dot. By default, Java uses the rules for the language of the operating system, so `"I".toLowerCase()` will return `"i"` on an English system and `"ı"` on a Turkish one. \ No newline at end of file +In different languages the mapping between upper-case and lower-case letters can differ. + +For example, in Turkish the lower-case form of the letter `I` is `ı` and not `i`. +By default, Java uses the rules for the language of the computer it is running on. +So `"I".toLowerCase()` will return `"i"` on an English system and `"ı"` on a Turkish one. + +To get behavior that is consistent regardless of the machine it is being run on +you can pass use an explicit `Locale`. + +```java +~void main() { +IO.println("I".toLowerCase(Locale.US)); // i - on every computer +IO.println("I".toLowerCase(Locale.forLanguageTag("tr-TR"))); // ı - on every computer +~} +``` \ No newline at end of file From cacc3b4038be1033017614353ad9502d7190bcf4 Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Tue, 16 Sep 2025 19:59:21 -0400 Subject: [PATCH 03/13] Update UPPERCASE.md --- src/strings_ii/UPPERCASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/strings_ii/UPPERCASE.md b/src/strings_ii/UPPERCASE.md index 07f518a..db62fc1 100644 --- a/src/strings_ii/UPPERCASE.md +++ b/src/strings_ii/UPPERCASE.md @@ -21,6 +21,7 @@ no matter what language the system is set to. void main() { String message = "Happy Valentines Day"; + // Same as above, no matter what. String upperCased = message.toUpperCase(Locale.US); IO.println(upperCased); } From ccdec0b87d424f4cd0edccc64201b838b7d20ea8 Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Tue, 16 Sep 2025 20:00:50 -0400 Subject: [PATCH 04/13] ... --- src/annotations/override.md | 2 +- src/annotations/target.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/annotations/override.md b/src/annotations/override.md index ba78a44..bdbc3f0 100644 --- a/src/annotations/override.md +++ b/src/annotations/override.md @@ -6,7 +6,7 @@ is an annotation. There's not much else to say besides "hey, thats what that was!" but I think its worth noting. -```java +```java,no_run interface Num { boolean odd(); diff --git a/src/annotations/target.md b/src/annotations/target.md index 81e5f9d..ffd8fc9 100644 --- a/src/annotations/target.md +++ b/src/annotations/target.md @@ -7,7 +7,7 @@ The first of these "meta-annotations" you are likely to use is `@Target`. By default an annotation can mark anything, but you can use `@Target` to restrict what can be marked.[^typeuse] -```java +```java,no_run import java.lang.annotation.ElementType; import java.lang.annotation.Target; From e8dd89a88bf253716c5740cdf5ac8376015ecbc6 Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Tue, 16 Sep 2025 20:21:46 -0400 Subject: [PATCH 05/13] Update lowercase.md --- src/strings_ii/lowercase.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings_ii/lowercase.md b/src/strings_ii/lowercase.md index 6bf6789..d9524f8 100644 --- a/src/strings_ii/lowercase.md +++ b/src/strings_ii/lowercase.md @@ -16,7 +16,7 @@ void main() { This does not change the original `String` in place. It just makes a new `String` with all lower-case letters. -Many other languages also have a distinction between upper-case and lower-case and, usually, `.toLowerCase()` does the "right thing" for them too: +Many other languages also have a distinction between upper-case and lower-case and, usually, `.toLowerCase()` does the "right thing" for them. ```java ~void main() { From 75f6fd25ac7c007fedaf56e1000e9811968678d8 Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Thu, 18 Sep 2025 21:28:50 -0400 Subject: [PATCH 06/13] Resolve #133 and #134 --- src/the_terminal/commands.md | 6 ++++-- src/the_terminal/creating_files.md | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/the_terminal/commands.md b/src/the_terminal/commands.md index fc727a3..80d85d2 100644 --- a/src/the_terminal/commands.md +++ b/src/the_terminal/commands.md @@ -2,7 +2,7 @@ The primary way you interact with a terminal is by running commands. -You start with a blank prompt and write something like the following. +You start with a blank prompt and write something like the following[^nottyped]. ```bash $ echo Hello @@ -10,4 +10,6 @@ Hello ``` The first word is the name of the program to run. In this case `echo`. Everything after -that is an "argument" to the program. \ No newline at end of file +that is an "argument" to the program. + +[^nottyped] You don't actually type the `$`. That is illustrative. Your terminal will give you something like a `$` or a `>` as a "prompt." \ No newline at end of file diff --git a/src/the_terminal/creating_files.md b/src/the_terminal/creating_files.md index 54069e2..546281e 100644 --- a/src/the_terminal/creating_files.md +++ b/src/the_terminal/creating_files.md @@ -1,6 +1,6 @@ # Creating Files -To create a blank file you can use the `touch`[^no_clue] command. +To create a blank file you can use the `touch`[^why] command. ```bash $ touch hello.txt @@ -12,8 +12,10 @@ using a program called a "text editor." There are some text editors, like [`vim`](https://www.vim.org/), which run entirely inside the terminal.[^diehard] -One of the more popular ones at time of writing is [Visual Studio Code](https://code.visualstudio.com/). If you weren't otherwise shown a different option, that is a decent default. Install it and then you can use it to create and edit files. +At the start of this book I showed you [VSCodium](https://vscodium.com/). If you weren't otherwise shown a different option, that is a decent default. You can use it to create and edit files. + +[^why]: This is called `touch` because it will "touch" a file and update its "last updated timestamp" but change nothing else. -[^no_clue]: I have no clue why this is called `touch`. [^diehard]: These have their die hard supporters. The lunatics. + [^thisbook]: This book has been written inside Visual Studio Code. From 642f300629894f15799bfe26f874b6ae67449e1c Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Thu, 18 Sep 2025 21:38:50 -0400 Subject: [PATCH 07/13] Resolve #136 --- .../conversion_to_integers.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/floating_point_numbers/conversion_to_integers.md b/src/floating_point_numbers/conversion_to_integers.md index 6d571ca..1b235c6 100644 --- a/src/floating_point_numbers/conversion_to_integers.md +++ b/src/floating_point_numbers/conversion_to_integers.md @@ -48,6 +48,21 @@ IO.println(z); ~} ``` +Negative numbers will also have their decimal part dropped. So numbers like `-7.2`, `-7.6`, and `-7.9` will +all be converted into `-7`. + +```java +~void main() { +int x = (int) -7.2; +int y = (int) -7.6; +int z = (int) -7.9; + +IO.println(x); +IO.println(y); +IO.println(z); +~} +``` + Any number that is too big to store in an `int` will be converted to the biggest possible `int`, 231 - 1. ```java From ac8341a1d48fafb4714151303cd01710cf92cf02 Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Fri, 19 Sep 2025 16:24:47 -0400 Subject: [PATCH 08/13] Update all javadoc and spec links to 25 #137 --- src/annotations/elements.md | 2 +- src/class_extension/challenges.md | 2 +- src/conclusion/what_now.md | 4 ++-- src/documentation/challenges.md | 2 +- src/documentation/javadoc.md | 2 +- src/hash_maps/challenges.md | 2 +- src/loops_iii/for_each_loops.md | 2 +- src/loops_iii/iterable_and_iterator.md | 4 ++-- src/packages/challenges.md | 2 +- src/reflection/challenges.md | 2 +- src/static_methods/math.md | 2 +- src/streams/challenges.md | 2 +- src/time/date.md | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/annotations/elements.md b/src/annotations/elements.md index ddafa23..1ec5d9d 100644 --- a/src/annotations/elements.md +++ b/src/annotations/elements.md @@ -63,4 +63,4 @@ class PersonInCharge {} } ``` -[^fulllist]: You can find the full list [here](https://docs.oracle.com/javase/specs/jls/se23/html/jls-9.html#jls-9.6). It is a short list. +[^fulllist]: You can find the full list [here](https://docs.oracle.com/javase/specs/jls/se25/html/jls-9.html#jls-9.6). It is a short list. diff --git a/src/class_extension/challenges.md b/src/class_extension/challenges.md index 7ce219c..bc07c92 100644 --- a/src/class_extension/challenges.md +++ b/src/class_extension/challenges.md @@ -39,7 +39,7 @@ class Main { ## Challenge 2. Rewrite your `Tree` class from above to instead extend `AbstractList`. -You can find the documentation for `AbstractList` [here](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html). +You can find the documentation for `AbstractList` [here](https://docs.oracle.com/javase/25/docs/api/java/util/AbstractList.html). ## Challenge 3. diff --git a/src/conclusion/what_now.md b/src/conclusion/what_now.md index 88bb87a..43447f7 100644 --- a/src/conclusion/what_now.md +++ b/src/conclusion/what_now.md @@ -117,7 +117,7 @@ to in order to render websites. There are a lot of tools for this in Java. A lot a lot. I would recommend starting with the one that comes built-in: the `jdk.httpserver` module. -[Docs for `jdk.httpserver` here](https://docs.oracle.com/en/java/javase/24/docs/api/jdk.httpserver/module-summary.html) +[Docs for `jdk.httpserver` here](https://docs.oracle.com/en/java/javase/25/docs/api/jdk.httpserver/module-summary.html) Then you will need to learn about SQL databases and how to query from/insert into them from Java. @@ -147,7 +147,7 @@ two paths. Path #1 is to learn Java Swing. This is an old crusty GUI framework that is kinda difficult to use but has the pro of coming with Java and being able to run on every potato in existence. -[Docs for `java.desktop` (Swing) here](https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/module-summary.html) +[Docs for `java.desktop` (Swing) here](https://docs.oracle.com/en/java/javase/25/docs/api/java.desktop/module-summary.html) Path #2 is the learn JavaFX. By all accounts JavaFX is better software than Swing, but it was cursed by coming out at a point in history where desktop apps were no longer big business to develop. It diff --git a/src/documentation/challenges.md b/src/documentation/challenges.md index 6f80575..900f296 100644 --- a/src/documentation/challenges.md +++ b/src/documentation/challenges.md @@ -19,6 +19,6 @@ Fix these by documenting that code enough that `javadoc` no longer gives you war ## Challenge 3. -Read the [documentation for java.util.StringJoiner](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/util/StringJoiner.html). +Read the [documentation for java.util.StringJoiner](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/StringJoiner.html). If you can, alter one of your projects to use it. \ No newline at end of file diff --git a/src/documentation/javadoc.md b/src/documentation/javadoc.md index 981ad8a..53b511f 100644 --- a/src/documentation/javadoc.md +++ b/src/documentation/javadoc.md @@ -17,6 +17,6 @@ javadoc \ This will produce a directory full of HTML files that contain all the documentation from the specified modules. -This is what is used to make [the official Java documenation](https://docs.oracle.com/en/java/javase/24/docs/api/index.html) as well as at least part of the documentation for most Java libraries. +This is what is used to make [the official Java documenation](https://docs.oracle.com/en/java/javase/25/docs/api/index.html) as well as at least part of the documentation for most Java libraries. [^theme]: As is a theme with command-line tools \ No newline at end of file diff --git a/src/hash_maps/challenges.md b/src/hash_maps/challenges.md index 077ffe7..684bba4 100644 --- a/src/hash_maps/challenges.md +++ b/src/hash_maps/challenges.md @@ -90,7 +90,7 @@ class Main { ``` If you feel like this is hard to do with just `.put` and `.get`, you can -check for [other methods on HashMap that can help you](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/util/HashMap.html). +check for [other methods on HashMap that can help you](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/HashMap.html). ## Challenge 3. diff --git a/src/loops_iii/for_each_loops.md b/src/loops_iii/for_each_loops.md index d4fdc11..c5e78ea 100644 --- a/src/loops_iii/for_each_loops.md +++ b/src/loops_iii/for_each_loops.md @@ -35,4 +35,4 @@ for (Bread bread : breads) { ``` -[^enhanced]: You might see this referred to as an "enhanced for statement." [That is its name in the language spec](https://docs.oracle.com/javase/specs/jls/se23/html/jls-14.html#jls-14.14.2) but not the name most people will use. \ No newline at end of file +[^enhanced]: You might see this referred to as an "enhanced for statement." [That is its name in the language spec](https://docs.oracle.com/javase/specs/jls/se25/html/jls-14.html#jls-14.14.2) but not the name most people will use. \ No newline at end of file diff --git a/src/loops_iii/iterable_and_iterator.md b/src/loops_iii/iterable_and_iterator.md index 2f4d9e4..d7d66d0 100644 --- a/src/loops_iii/iterable_and_iterator.md +++ b/src/loops_iii/iterable_and_iterator.md @@ -3,7 +3,7 @@ For things that are not arrays, a for-each loops are built on top of two interfaces: `java.lang.Iterable` and `java.lang.Iterator`. -The [`Iterator`](https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/Iterator.html) interface defines two methods: `hasNext` and `next`[^remove]. Iterators let you box up the logic of +The [`Iterator`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Iterator.html) interface defines two methods: `hasNext` and `next`[^remove]. Iterators let you box up the logic of how to loop over something. ```java,no_run @@ -17,7 +17,7 @@ public interface Iterator { } ``` -[`Iterable`](https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/Iterable.html) then +[`Iterable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Iterable.html) then just has one method which gives you an `Iterator`. ```java,no_run diff --git a/src/packages/challenges.md b/src/packages/challenges.md index e7996b2..cd24633 100644 --- a/src/packages/challenges.md +++ b/src/packages/challenges.md @@ -28,7 +28,7 @@ This will require marking the classes and many of the methods within `public`. ## Challenge 3. -Read through [the list of packages that come with Java](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/module-summary.html). You don't need to understand everything you are looking at; just +Read through [the list of packages that come with Java](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/module-summary.html). You don't need to understand everything you are looking at; just browse and try to find at least one class that interests you. Import that class and try to use it. diff --git a/src/reflection/challenges.md b/src/reflection/challenges.md index 3d598a0..b6dc1bf 100644 --- a/src/reflection/challenges.md +++ b/src/reflection/challenges.md @@ -12,7 +12,7 @@ as input and returns if the name of the underlying class for that `Object` starts with a vowel. You might need to consult the documentation -for [Class](https://docs.oracle.com/en/java/javase/24/docs/api/index.html). +for [Class](https://docs.oracle.com/en/java/javase/25/docs/api/index.html). ```java,editable class Apple {} diff --git a/src/static_methods/math.md b/src/static_methods/math.md index 4ada1db..c0fab92 100644 --- a/src/static_methods/math.md +++ b/src/static_methods/math.md @@ -17,4 +17,4 @@ an instance of a class to call them would be silly. The `Math` class that comes with Java has methods that work in this way. `Math.max(a, b)` is `static` and therefore usable everywhere you want the maximum of two numbers.[^more] -[^more]: There are way more on there. [Take a look](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Math.html). \ No newline at end of file +[^more]: There are way more on there. [Take a look](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Math.html). \ No newline at end of file diff --git a/src/streams/challenges.md b/src/streams/challenges.md index 6ffb3a3..bf33745 100644 --- a/src/streams/challenges.md +++ b/src/streams/challenges.md @@ -46,7 +46,7 @@ class Main { ## Challenge 3. -Read the documentation on [`Collector`](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/util/stream/Collector.html) and [`Collectors`](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/util/stream/Collector.html). +Read the documentation on [`Collector`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/stream/Collector.html) and [`Collectors`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/stream/Collector.html). Make an implementation of `Collector` that can collect elements into `MySpecialList`. diff --git a/src/time/date.md b/src/time/date.md index 6da42bc..d04bc26 100644 --- a/src/time/date.md +++ b/src/time/date.md @@ -56,4 +56,4 @@ class Main { To be clear though, `Date` has problems. We aren't ready to explain all of them yet. Just treat `Date` as haunted, as in by ghosts, and use the `java.time` alternatives when you can. -[^gmt]: You will notice that when we print out the date we get GMT. GMT is basically the same as UTC, though [the documentation for `Date`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Date.html) explains the difference. \ No newline at end of file +[^gmt]: You will notice that when we print out the date we get GMT. GMT is basically the same as UTC, though [the documentation for `Date`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Date.html) explains the difference. \ No newline at end of file From 703b1b0216712525b1266074b63fac969a429ebf Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Fri, 19 Sep 2025 16:29:13 -0400 Subject: [PATCH 09/13] Fix #138 --- src/characters/conversion_to_integers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/characters/conversion_to_integers.md b/src/characters/conversion_to_integers.md index 4c152a4..a4f2d15 100644 --- a/src/characters/conversion_to_integers.md +++ b/src/characters/conversion_to_integers.md @@ -30,4 +30,4 @@ IO.println(isLetter); This can be useful if you are stranded on Mars[^onmars] or if you want to see if a character is in some range. -[^onmars]: https://www.youtube.com/watch?v=0xkP_FQUsuM +[^onmars]: [https://www.youtube.com/watch?v=0xkP_FQUsuM](https://www.youtube.com/watch?v=0xkP_FQUsuM) From 6c53f6e39a69d5d6b6be669532111a92df4d7296 Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Fri, 19 Sep 2025 16:32:23 -0400 Subject: [PATCH 10/13] #139 --- src/characters/conversion_to_integers.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/characters/conversion_to_integers.md b/src/characters/conversion_to_integers.md index a4f2d15..1e2d8f1 100644 --- a/src/characters/conversion_to_integers.md +++ b/src/characters/conversion_to_integers.md @@ -1,6 +1,6 @@ # Conversion to Integers -All `char`s have a matching numeric value. `'a'` is `97`, `'b'` is `98`, +All `char`s have a matching numeric value[^ascii]. `'a'` is `97`, `'b'` is `98`, `'&'` is `38`, and so on. Same as assigning an `int` to a `double`, you can perform a widening conversion @@ -30,4 +30,6 @@ IO.println(isLetter); This can be useful if you are stranded on Mars[^onmars] or if you want to see if a character is in some range. +[^ascii]: You can find some of these values in an "[ASCII Table](https://www.ascii-code.com/)." + [^onmars]: [https://www.youtube.com/watch?v=0xkP_FQUsuM](https://www.youtube.com/watch?v=0xkP_FQUsuM) From e61bf2e0f7112cd6f8635124c874f8efec2af50e Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Fri, 19 Sep 2025 16:33:46 -0400 Subject: [PATCH 11/13] #140 --- src/strings/common_escape_sequences.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings/common_escape_sequences.md b/src/strings/common_escape_sequences.md index cf2ac00..9861120 100644 --- a/src/strings/common_escape_sequences.md +++ b/src/strings/common_escape_sequences.md @@ -25,7 +25,7 @@ you need to escape the first backslash.[^forwardslash] ```java ~void main() { -// The first backslash needs to be escaped. ¯\_(ツ)_/¯ +// The backslash needs to be escaped. ¯\_(ツ)_/¯ String shruggie = "¯\\_(ツ)_/¯"; ~} ``` From fddd0a5c44e5e8a11b2376fc5fca1832daa1ac9f Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Fri, 19 Sep 2025 16:35:32 -0400 Subject: [PATCH 12/13] #141 --- src/branching_logic/nested_ifs.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/branching_logic/nested_ifs.md b/src/branching_logic/nested_ifs.md index cd26f14..ee36679 100644 --- a/src/branching_logic/nested_ifs.md +++ b/src/branching_logic/nested_ifs.md @@ -17,7 +17,7 @@ if (age < 25) { When an `if` is inside another `if` we say that it is "nested". If you find yourself nesting more than a few `if`s that might be a sign that -you should reach out for help. +you should reach out for help[^or]. ```java,no_run if (...) { @@ -30,3 +30,5 @@ if (...) { } } ``` + +[^or]: Or a sign that you should keep reading. There are things I will show you that can help you avoid this - like "methods." From 5ccd7332838c25d88a335729cff17c6ccb427773 Mon Sep 17 00:00:00 2001 From: Ethan McCue Date: Fri, 19 Sep 2025 16:37:00 -0400 Subject: [PATCH 13/13] #142 --- src/loops_ii/comparison_to_while.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loops_ii/comparison_to_while.md b/src/loops_ii/comparison_to_while.md index a04655e..289422b 100644 --- a/src/loops_ii/comparison_to_while.md +++ b/src/loops_ii/comparison_to_while.md @@ -57,7 +57,7 @@ while (index < numbers.length) { Us humans, with our tiny monkey brains, can get very lost when things that are related to each other are separated by long distances. -In this dimension, for loops are superior. All the bits of code that "control the loop" can be right at the top. +In this dimension, `for` loops are superior. All the bits of code that "control the loop" can be right at the top. ```java ~void main() {