Learn Java Tutorial for Beginners, Part 12: Multi-dimensional Arrays

///Learn Java Tutorial for Beginners, Part 12: Multi-dimensional Arrays

Learn Java Tutorial for Beginners, Part 12: Multi-dimensional Arrays

FavoriteLoadingAdd to favorites

More courses! Free C++ course:
Make a social network with Spring Boot:
Learn about MySQL and relational databases:
Java desktop programming:
Intermediate-Advanced C++ 11:
——————————————————————————————————————————————-
How to work with multi-dimensional arrays in Java, including some tips on how to remember which index is which
——————————————————————————————————————————————–
More videos on my YouTube channel:

Java468x60

.

source

By |2020-01-10T01:06:43+00:00January 10th, 2020|Java Video Tutorials|22 Comments

22 Comments

  1. Matin Naqshbandi January 10, 2020 at 1:06 am - Reply

    Johnny Ive, is that you?

  2. Georsie Fils January 10, 2020 at 1:06 am - Reply

    Can you also do that for Strings?

  3. siau chuen Voon January 10, 2020 at 1:06 am - Reply

    thanks John, you are an Excellent teacher.

  4. Michal Mankus January 10, 2020 at 1:06 am - Reply

    holy fucking mary, this is the best tutorial on 2-dimensional arrays I have found so far. especially the narration on 2x nested for loop. no need to rewatch. you made complex simple.

  5. Steven Barnes January 10, 2020 at 1:06 am - Reply

    John is probably the best teacher of Java on the internet. He goes into the perfect amount of detail needed to understand exactly how it works. I would be no where near as good at programming if it wasn't for John so thanks so much for the videos 🙂

  6. Маргарита Бабенко January 10, 2020 at 1:06 am - Reply

    Could you give me an example of how 1D and 2D arrays can be used? I understand more or less what it is and how it works, but what it CAN DO in existing program or a game? Why do we need it? This way it's much easier to understand the structure. Thanks!

  7. Shinsha January 10, 2020 at 1:06 am - Reply

    Too much Arrayception! But thanks for the video it was really helpful 🙂

  8. Artemus Dolgin January 10, 2020 at 1:06 am - Reply

    Good job. I started learning java few days ago and i understand it all but it's really hard for me put theory to practice

  9. Naveenkumar Malladi January 10, 2020 at 1:06 am - Reply

    excellent

  10. Mahadi The Learning Mind January 10, 2020 at 1:06 am - Reply

    u r a good teacher with smooth voice , , , many thanks man !

  11. Abdullah Abu Shuaib January 10, 2020 at 1:06 am - Reply

    thanks for the tutorial, you're a great teacher by the way!
    so this is what we do to print an array like this one, using for loop .
    String[] G = {"CAT","DOG","BEE"};
    for (String H : G){
    System.out.print(H + "t");
    now… how to print these Multi-dimensional Arrays using for loop ?
    String[][] D = {
    {"Cat","Dog","fish"},
    {"Apple","Disk","Table"},
    {"Door","Cup","Lock"}
    };
    if it's even possible .

  12. sai prasad January 10, 2020 at 1:06 am - Reply

    for (int row=0;row<grid.length;row++){
    for (int col=0;col<grid[row].length;col++) plss expail the iterration

  13. Marcus Aderele January 10, 2020 at 1:06 am - Reply

    You're, right! This was really complex. Hopefully I will get it with time the next time I to use a multi-dimensional array. Thanks for making these videos, and keep up the great work.

  14. Mofreh Sarhan January 10, 2020 at 1:06 am - Reply

    Excellent as usual, Keep the good work
    Thank you very much for making Java programming enjoable

  15. Antoni Theodorou January 10, 2020 at 1:06 am - Reply

    Hello there, first thx for this vid =) I need to code a pong game with this 2D Array without using a GUI or something else it has to be print on console..how can i make something  moving in this 2D Array ? For example the ball ? I may need to Change Index Posiotions of the ball but i dont know how to solve this Problem..

  16. Heat4Life January 10, 2020 at 1:06 am - Reply

    I don't really Understand this part:

    for(int row = 0; row < grid.length; row++) {
    for(int col = 0; col < grid[row].length; col++) {
    System.out.print(grid[row][col] + "t");
    }

    System.out.println();
    }

  17. Rahul January 10, 2020 at 1:06 am - Reply

    System.out.println(Arrays.toString(/Array Name/);
    Doesn't work in this case, why?

  18. Mamunur Rashid January 10, 2020 at 1:06 am - Reply

    Nice.

  19. 서정호 January 10, 2020 at 1:06 am - Reply

    When you create row&col table in for loop above, do you have to write row in for loop in the first line, then col in the next line? What if they swap their lines?

  20. damx x January 10, 2020 at 1:06 am - Reply

    Very nice tutorial
    I am confused you say
    that in a two dimensional array columns and rows exist
    That seems to be true for the first example but does not seem true for the second String example
    This is my code

    String[][] text = new String[4][4];
    text[0][0] = "Hello sparky dog";
    text[1][1] = "Good bye";
    text[2][2] = "Hello again";
    text[3][3] = "wake up";
    System.out.println(text[0][0]);
    System.out.println(text [1][1]);
    System.out.println(text [2][2]);
    System.out.println(text [3][3])

    Seems like to me columns do not exist in the above example
    But what does exist are only rows that need 2 numbers text[3][4] that are equal to the System.out.ptintln numbers [3][4]
    Can you provide a code example of how rows and columns pertain to this code?

    Thanks again for your tutorials

  21. JJ2422 January 10, 2020 at 1:06 am - Reply

    what does grid.length equal to ? cause im not familiar with the .length function. Please specify

    Thanks!!!

  22. The gamer January 10, 2020 at 1:06 am - Reply

    hey John … this my code … like what u write. .. but it didn't work good…
    class Myclass
    {
    public static void main(String[] args)
    {

    int [][] ar = { {3,8643,864},
    {4,57,5},
    };

    System.out.println(ar.length);

    for (int x = 0 ; x < (ar.length ); x++){
    for (int j = 0; j < ar[x].length ;j++){
    System.out.println(ar [x] [j] + "t" );
    }
    System.out.println();
    }

    }
    }

    when run
    2
    3
    8643
    864

    4
    57
    5

Leave A Comment

*