From 0061c67e403bca950e0d6c608551e11cbde93091 Mon Sep 17 00:00:00 2001 From: melonpan <73855155+melonpan@users.noreply.github.com> Date: Sun, 3 Nov 2024 23:46:08 -0300 Subject: [PATCH 1/4] Update about.md --- concepts/arrays/about.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concepts/arrays/about.md b/concepts/arrays/about.md index b7588364b..3793c0a0b 100644 --- a/concepts/arrays/about.md +++ b/concepts/arrays/about.md @@ -44,7 +44,7 @@ int secondElement = twoInts[1]; Accessing an index that is outside of the valid indexes for the array results in an `IndexOutOfBoundsException`. Arrays can be manipulated by either calling an array instance's methods or properties, or by using the static methods defined in the `Arrays` class (typically only used in generic code). -The most commonly used property for arrays is its length which can be accessed like this: +Java has a built-in `length` property that returns the length of an array, which can be accessed like this: ```java int arrayLength = someArray.length; From 6aa415aaf05d5fa578f55b69263c92390d01414f Mon Sep 17 00:00:00 2001 From: melonpan <73855155+melonpan@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:35:40 -0300 Subject: [PATCH 2/4] improve explanation on Java array .length property --- exercises/concept/bird-watcher/.docs/introduction.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/concept/bird-watcher/.docs/introduction.md b/exercises/concept/bird-watcher/.docs/introduction.md index c8b1bddbc..0c3f689a8 100644 --- a/exercises/concept/bird-watcher/.docs/introduction.md +++ b/exercises/concept/bird-watcher/.docs/introduction.md @@ -46,7 +46,8 @@ int secondElement = twoInts[1]; Accessing an index that is outside of the valid indexes for the array results in an `IndexOutOfBoundsException`. Arrays can be manipulated by either calling an array instance's methods or properties, or by using the static methods defined in the `Arrays` class (typically only used in generic code). -The most commonly used property for arrays is its length which can be accessed like this: +The `length` property holds the length of an array. +It can be accessed like this: ```java int arrayLength = someArray.length; From c39cad8fdab14291bd19bba5822e9836b44e4785 Mon Sep 17 00:00:00 2001 From: melonpan <73855155+melonpan@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:37:42 -0300 Subject: [PATCH 3/4] improve explanation on Java array .length property --- concepts/arrays/introduction.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/concepts/arrays/introduction.md b/concepts/arrays/introduction.md index 218b91869..7d2db108e 100644 --- a/concepts/arrays/introduction.md +++ b/concepts/arrays/introduction.md @@ -44,7 +44,8 @@ int secondElement = twoInts[1]; Accessing an index that is outside of the valid indexes for the array results in an `IndexOutOfBoundsException`. Arrays can be manipulated by either calling an array instance's methods or properties, or by using the static methods defined in the `Arrays` class (typically only used in generic code). -The most commonly used property for arrays is its length which can be accessed like this: +The `length` property holds the length of an array. +It can be accessed like this: ```java int arrayLength = someArray.length; From c2a03c172a4dd7ce4452d7b5cff22807fc938129 Mon Sep 17 00:00:00 2001 From: melonpan <73855155+melonpan@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:39:52 -0300 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Kah Goh --- concepts/arrays/about.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/concepts/arrays/about.md b/concepts/arrays/about.md index 3793c0a0b..8f87bd4db 100644 --- a/concepts/arrays/about.md +++ b/concepts/arrays/about.md @@ -44,7 +44,8 @@ int secondElement = twoInts[1]; Accessing an index that is outside of the valid indexes for the array results in an `IndexOutOfBoundsException`. Arrays can be manipulated by either calling an array instance's methods or properties, or by using the static methods defined in the `Arrays` class (typically only used in generic code). -Java has a built-in `length` property that returns the length of an array, which can be accessed like this: +The `length` property holds the length of an array. +It can be accessed like this: ```java int arrayLength = someArray.length;