From 035b179bc67ffa8e701987fb857b9d5fdeed47e9 Mon Sep 17 00:00:00 2001 From: lalmendra <109772135+lalmendra@users.noreply.github.com> Date: Fri, 25 Sep 2026 23:56:27 -0300 Subject: [PATCH 1/4] Update field_access.md --- src/classes/field_access.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/field_access.md b/src/classes/field_access.md index 09865939..d38fca27 100644 --- a/src/classes/field_access.md +++ b/src/classes/field_access.md @@ -1,7 +1,7 @@ # Field Access You can access the value of any field in a class by writing the name of a variable holding an instance -of that class, `.`, then the name of that field. +of that class, plus a `.`, then the name of that field. ```java class Muppet { From 17205d867ad6e152c3d849465b2e3d4c6a9b525e Mon Sep 17 00:00:00 2001 From: lalmendra <109772135+lalmendra@users.noreply.github.com> Date: Sat, 26 Sep 2026 02:17:41 -0300 Subject: [PATCH 2/4] Update challenges.md sent challenge 4 to position 6, as it seemed the most difficult, at least to me --- src/instance_methods/challenges.md | 60 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/instance_methods/challenges.md b/src/instance_methods/challenges.md index 45cc118f..2a9c3a08 100644 --- a/src/instance_methods/challenges.md +++ b/src/instance_methods/challenges.md @@ -111,34 +111,6 @@ void main() { ## Challenge 4. -Make a `Rectangle` class which has a `width` field and a `height` -field. Give it an instance method named `toCharArray` which gives -a `char[]` that can be printed to display a rectangle of the given -width and height. - -```java,editable -// ------------ -// CODE HERE -// ------------ - -void main() { - Rectangle rectangle = new Rectangle(); - rectangle.width = 3; - rectangle.height = 4; - - /* - *** - *** - *** - *** - */ - char[] c = rectangle.toCharArray(); - IO.println(c); -} -``` - -## Challenge 5. - Update the definition for the `Taco` class so that it has a method named `deluxe`. This should set the taco to have beef, sour cream, cheese, and onion. Use the existing instance methods instead of directly accessing @@ -185,7 +157,7 @@ void main() { } ``` -## Challenge 6. +## Challenge 5. Why doesn't this code function as you'd expect? Fix it by changing one line. @@ -203,4 +175,32 @@ void main() { oscar.setGrouchy(true); IO.println(oscar.grouchy); } -``` \ No newline at end of file +``` + +## Challenge 6. + +Make a `Rectangle` class which has a `width` field and a `height` +field. Give it an instance method named `toCharArray` which gives +a `char[]` that can be printed to display a rectangle of the given +width and height. + +```java,editable +// ------------ +// CODE HERE +// ------------ + +void main() { + Rectangle rectangle = new Rectangle(); + rectangle.width = 3; + rectangle.height = 4; + + /* + *** + *** + *** + *** + */ + char[] c = rectangle.toCharArray(); + IO.println(c); +} +``` From bb40782338195555142c48e6c5652d10fb748ce7 Mon Sep 17 00:00:00 2001 From: lalmendra <109772135+lalmendra@users.noreply.github.com> Date: Sat, 26 Sep 2026 02:33:21 -0300 Subject: [PATCH 3/4] Update challenges.md Using just "IO.println(c)" was printing c as an Object. Adjusted to convert it to String before printing --- src/instance_methods/challenges.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instance_methods/challenges.md b/src/instance_methods/challenges.md index 2a9c3a08..64612248 100644 --- a/src/instance_methods/challenges.md +++ b/src/instance_methods/challenges.md @@ -201,6 +201,6 @@ void main() { *** */ char[] c = rectangle.toCharArray(); - IO.println(c); + IO.println(new String(c)); } ``` From fdc18ba3ecc50518e7bc4bb27464c6dc923a22bb Mon Sep 17 00:00:00 2001 From: lalmendra <109772135+lalmendra@users.noreply.github.com> Date: Thu, 1 Oct 2026 20:58:54 -0300 Subject: [PATCH 4/4] Update throw.md --- src/exceptions/throw.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/exceptions/throw.md b/src/exceptions/throw.md index d90dc910..1f5e84fd 100644 --- a/src/exceptions/throw.md +++ b/src/exceptions/throw.md @@ -3,8 +3,7 @@ In order to throw an exception from your own code, you say `throw`, `new`, then the name of the exception and `()`. -`RuntimeException` is one of many kinds of exceptions, but you can make do with only -that in your own code for a bit. +`RuntimeException` is one of many kinds of exceptions, but you can get by with just that one in your own code for a bit. ```java,panics void crashesOnFive(int x) { @@ -20,4 +19,4 @@ void main() { crashesOnFive(5); IO.println("Will not make it to step 2"); } -``` \ No newline at end of file +```