Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

akshayahuja230
Copy link

@akshayahuja230 akshayahuja230 commented Jun 25, 2025

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

Screenshot 2025-06-25 233509
Screenshot 2025-06-25 233537

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!

Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the 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.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jun 25, 2025
@@ -0,0 +1,576 @@
<!DOCTYPE html>
Copy link
Contributor

@danthe1st danthe1st Jun 25, 2025

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.

Copy link
Author

@akshayahuja230 akshayahuja230 Jun 25, 2025

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!

Copy link
Contributor

@danthe1st danthe1st left a 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">&nbsp;</a>
Copy link
Contributor

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">&nbsp;</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.
Copy link
Contributor

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
Copy link
Contributor

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.

@danthe1st
Copy link
Contributor

danthe1st commented Jun 25, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants