Skip to content

Commit 042d757

Browse files
authored
Clarify distinction between arrays and collections
Updated the description of Java arrays to avoid confusion with the term "collection" as used in the Java Collections Framework. Previously, the text referred to arrays as collections, which is inaccurate in Java's formal terminology. The native Java arrays are not part of the Collections Framework, as they do not implement the `Collection` interface or its subtypes, such as `List`, `Set`, or `Map`. They are simply fixed-size objects that hold elements of the same type. This change helps prevent misunderstanding and aligns the description with Java's official definitions.
1 parent f93ed81 commit 042d757

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

concepts/arrays/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Introduction to Arrays
22

3-
In Java, data structures that can hold zero or more elements are known as _collections_.
4-
An **array** is a collection that has a fixed size and whose elements must all be of the same type.
3+
In Java, arrays are a way to store multiple values of the same type in a single structure.
4+
Unlike other data structures, arrays have a fixed size once created.
55
Elements can be assigned to an array or retrieved from it using an index.
66
Java arrays use zero-based indexing: the first element's index is 0, the second element's index is 1, etc.
77

0 commit comments

Comments
 (0)