-
Notifications
You must be signed in to change notification settings - Fork 26
Enhancement #60: Added Nested Arrays Documentation #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Enhancement #60: Added Nested Arrays Documentation #169
Conversation
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
@@ -0,0 +1,576 @@ | |||
<!DOCTYPE html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an HTML file as opposed to just editing https://github.com/java/devjava-content/blob/main/app/pages/learn/01_tutorial/03_getting-to-know-the-language/02_basics/03_creating-arrays.md?
Disclaimer: I'm just an outside contributor, not a maintainer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @danthe1st ! Thanks for pointing that out — I've corrected the mistake by removing the index.html and replacing it with a properly formatted app/pages/learn/01_tutorial/03_getting-to-know-the-language/02_basics/03_creating-arrays.md. Please let me know if anything else needs to be adjusted!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the rendered content (in the website) or how it fits in.
Also note that (since I'm not a maintainer), my comments are merely suggestions.
In addition to all of that, note that I don't know how articles that are partly written by Oracle and partly by the Community are handled (e.g. should there be author references?) and (I think) signing the OCA is mandatory for (content) contributions.
@@ -209,6 +209,64 @@ Mr. Smith | |||
Ms. Jones | |||
``` | |||
|
|||
<a id="jagged"> </a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would need to be added to the table of contents (see the beginning of the Markdown file).
At that point, you might also want to change the last updated timestamp.
<a id="jagged"> </a> | ||
## Working with Jagged Arrays | ||
|
||
A **jagged array** (an array of arrays) in Java lets each row have a different length. For example, one row might have 3 elements while another has 2. To create a jagged array, first declare the outer array with a size but no specified inner lengths, then assign each sub-array its own size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are rectangular arrays introduced anywhere? If you are explaining arrays having different sizes, it might also be worth covering that you can create arrays with given dimension sizes.
|
||
--- | ||
|
||
## Step 1 – Declare the jagged array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about the use of headings here being a good idea.
But please also keep in mind that I don't know whether Oracle/the DevRel group wants to integrate these changes at all. I created the issue (#60) as a suggestion, this does not actually mean that the maintainers definitely want to have this is the repository. |
This PR #60 adds comprehensive coverage of:
✅ Creating nested arrays (rectangular & jagged)
✅ Accessing elements with multiple indices
✅ Memory visualization of array-of-arrays structures
✅ Practical use-cases with performance considerations
Sample Addition:
// Creating a jagged array
int[][] matrix = {
{1, 2}, // Row 0
{3, 4, 5}, // Row 1
{6} // Row 2
};
Why This Matters:
🔹 Fills a critical gap in array documentation
🔹 Helps beginners understand multidimensional data
🔹 Prepares developers for real-world data structures
I'm happy to:
• Adjust any technical depth
• Add more examples if needed
• Collaborate on refining the explanations
Hi, @ammbra, @carimura
Whenever you get a chance, I’d be grateful if you could review and approve the workflows.
Please let me know if there's anything else needed from my side. Thank you for your time!