CodeGym /Courses /New Java Syntax /Additional lessons for Level

Additional lessons for Level

New Java Syntax
Level 6 , Lesson 9
Available

In this level, you've taken another very important step in learning Java. You learned more about arrays, which will help you work with huge amounts of information. We dug into what arrays are, what types of arrays there are, and how to interact with them. As we conclude this topic, we suggest that you read a couple of articles that will deepen your knowledge.

Arrays in Java

Keep this material handy, as your personal cheat sheet for arrays. It explains the basics in a simple and straightforward manner. It starts from square one and walks you through what an array is, how an array is declared and created, how an array is initialized, and how to display an array.

Something about arrays

Never mind the title of the article. It would be better named "a lot of things about arrays" rather than "something about arrays". For example, how to initialize them, in a simple and fast way, how arrays are arranged in memory, what two-dimensional arrays are and how to use them to recreate game "Sea Battle".

Arrays class and its use

In this article, you will continue to investigate arrays and learn how you can use the methods of the Arrays class to solve a lot of typical tasks involving arrays. People usually don't write these methods from scratch. Writing them scratch is useful, and you will probably do it yourself. But later you can use the methods of the Arrays class. This is helpful!


6
Survey/quiz
Arrays, level 6, lesson 9
Unavailable
Arrays
Arrays
Comments (7)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Knightrider Level 12, London, United Kingdom
4 January 2025
For question 7, the answer array.length is marked as correct in the quiz, but that's actually misleading. array.length gives the number of rows, not the number of columns. If you want to determine the number of columns in a specific row, you would do it like this in code: int[][] array = { {1, 2, 3}, {4, 5}, {6, 7, 8, 9} }; System.out.println(array[0].length); // Outputs 3 (columns in row 0) System.out.println(array[1].length); // Outputs 2 (columns in row 1) System.out.println(array[2].length); // Outputs 4 (columns in row 2) This is how you correctly find the number of columns for each row in a 2D array."
Benjamin Joseph Lentine Level 8, Songwon, South Korea
21 July 2024
Finally, a quiz where all the questions are information from the lessons.
Bright Iniabasi Level 9, Nigeria
1 April 2024
I think there are no correct options in question 7. The questions says to select which option can be used to determine the number of columns in a 2-D array. I expected an option like, say, array[0].length, but none was present. I selected the option "array.length" (being the closest to what I thought was right) and I got the question "correct." I understand "array.length" is used only when determining the number of rows in a 2-D array. Am I missing something, or that was a mistake from CodeGym?
PQK Level 6, United States of America, Sweden
6 April 2024
Yup seems like a mistake made by codegym
Romant Level 15, Russia, Russian Federation
12 March 2022
why is it in lesson 9 on arrays??? after the arrays tasks?
abhishe_kira Level 18, India Expert
27 June 2023
So you can do your research on arrays and gain some knowledge after all when you become a programmer you will have to solve your problems by yourself so they are building a habit in you to do it in future.
theblockchainarborist Level 10, United States
13 January 2022
Missing the word "from" in the third from last sentence at the very bottom here. The paragraph it is located in is under the "Arrays class and its use" link.