Java Programming Tutorial - 34 - Table for Multi Arrays

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 729

  • @vyle-q2v
    @vyle-q2v 9 ปีที่แล้ว +250

    I love how helpful people are in the comment section. The comments in these tutorials are the least toxic I've seen in any youtube video.

    • @Bashir000
      @Bashir000 9 ปีที่แล้ว +1

      +Villexy herp i was just thinking that

    • @smittenessmee
      @smittenessmee 8 ปีที่แล้ว +23

      +Villexy herp I felt the same way too !!
      smart people don't have time to troll, we're here to learn !Go smart people!

    • @HarshGames
      @HarshGames 7 ปีที่แล้ว +6

      Yep, best comment section ever! Defiantly least toxic comments I've ever seen in any youtube channel before!

    • @dnangel4277
      @dnangel4277 6 ปีที่แล้ว +4

      Programmers are nice people :)

    • @hetaeramancer
      @hetaeramancer 3 ปีที่แล้ว +1

      oh really dod? pakyu

  • @GraverFILMS
    @GraverFILMS 8 ปีที่แล้ว +86

    Think of this line of code as a type writer. I won't get to why it's like a type writer yet but bear with me:
    This is the confusing part:
    for (int row = 0; row

    • @leonidasdavos2022
      @leonidasdavos2022 8 ปีที่แล้ว +1

      +Graver Thanks brother, much needed.

    • @GraverFILMS
      @GraverFILMS 8 ปีที่แล้ว

      +Leonidas Davos No problem

    • @sedricnicole5266
      @sedricnicole5266 8 ปีที่แล้ว

      +Graver thanks a lot mate

    • @rampage14x13
      @rampage14x13 7 ปีที่แล้ว +1

      Thank you for this insightful comment really helped me understand what was going on!

    • @Pbd-fl1sx
      @Pbd-fl1sx 7 ปีที่แล้ว

      Why does it do this part first
      for(int column=0;column

  • @ProdTheRs
    @ProdTheRs 9 ปีที่แล้ว +387

    Maybe people are failing to understand this easily because Bucky hasn't told us something which might seem obvious but people might not realize.
    If u have a 2D Array, int arry[][] = { {1,2,3}, {4,5,6} };
    arry.length = 2. Why? Because in the main array "Arry" There are 2 smaller arrays. That's why it will give you the number of arrays inside your array.
    If you want to know the length of one of the smaller arrays inside Arry then you would have to do:
    arry[0].length to know the length of the first smaller array (row). Why? Because 0 means the first as speaking in computer language.
    arry[1].length would give u the length of the second smaller array or second row.

    • @mandy7995
      @mandy7995 8 ปีที่แล้ว +4

      thnx i really needed it...

    • @thecoachabledev4108
      @thecoachabledev4108 8 ปีที่แล้ว +3

      thank you made it much easier

    • @robertreimann1846
      @robertreimann1846 8 ปีที่แล้ว

      lol. You didn't realize?? xD

    • @realityisenough
      @realityisenough 7 ปีที่แล้ว +47

      Fuck you Robert Reimann

    • @mykxel5089
      @mykxel5089 7 ปีที่แล้ว +3

      i'll use a single array for this..note(this is just my own way of doing it, there may be multiple easier ways)
      int arr[] = {1,2,3,4,5};
      for(int x = 0; x < arr.length; x ++)
      {
      // check if they have no remainder(i.e 0) when divided by 2
      if(arr[x]%2 == 0)
      {
      System.out.println(arr[x]);
      }
      }
      hope this helps :)

  • @RobertRaubenheimer
    @RobertRaubenheimer 9 ปีที่แล้ว +11

    for those of you who have just lost your mind...
    type this out, then think logically what the for loop column is doing, when it ends and what then happens to the for row loop...
    the overall "x" part of it is applied to firstarray and second array when calling the "display" method (or whatever you called it)...
    I really do hope this helps.

  • @odo432
    @odo432 12 ปีที่แล้ว +1

    I'm up to the 51st Java tutorial now but if you had a memory like mine you will realise you can't just simply watch these videos and move on. I did just that the first time, got to the 50th tutorial and forgot everything in the earlier ones and had to constantly re-watch. This time around I'm taking notes, taking my time and making my own examples. I've learned MUCH more because of this new approach and have a higher understanding of how things work in Java.

    • @scooby-dooafterlife6969
      @scooby-dooafterlife6969 3 ปีที่แล้ว

      have you finished the tutorial?

    • @odo432
      @odo432 3 ปีที่แล้ว

      @@scooby-dooafterlife6969 oh, wow. Probably. I don't remember. LOL.
      I now program using C# and Unity. Although I enjoy working with Unreal and Godot is also great for beginners.

    • @scooby-dooafterlife6969
      @scooby-dooafterlife6969 3 ปีที่แล้ว

      @@odo432 good

  • @GamingBoxChannel
    @GamingBoxChannel 11 ปีที่แล้ว +1

    god knows how many times you have helped students to pass their , tests , assignments , quiz and classworks ... you are a life saver

  • @rogernkosi8420
    @rogernkosi8420 8 ปีที่แล้ว +11

    Remember cartesian plane math? this is exactly it. int a[][] is sam as a[x][y], x is horizontal and x is vertical. also bar graphs and line graphs, X and Y axis, Y is dependent on X. in this multidimensional array the column which is Y is dependent on X which is the row.

  • @lightbikevids1422
    @lightbikevids1422 11 ปีที่แล้ว +10

    i wish my brain was bucky I would know every single thing he does tutorials on from physics to math to programming

  • @idsamuel
    @idsamuel 11 ปีที่แล้ว +8

    Listen to the birds in the background, without the background noise it would be so peaceful, programming in the heart of the nature that is :D

  • @johnbuggins9424
    @johnbuggins9424 11 ปีที่แล้ว

    I have to admit this is a much better way of going about it. I am simply writing out the code and trying to gain a rudimentary understanding but, once I get to about 40/50, I'm going to start again and take notes etc.

  • @GraemeStanding
    @GraemeStanding 12 ปีที่แล้ว

    To be honest, I think doing what you did is the best method. The purpose of going over everything once is basically to help give you a bigger picture view of how Java works.. I will probably get to about 50 before going back and restarting. I won't remember much, but I'll have a much better understanding due to having gone over everything once before. It's hard to watch something for the first time and take notes. Much easier the second time around!

  • @gordonwilliams3680
    @gordonwilliams3680 5 ปีที่แล้ว +1

    oh man i love you - thank you dude - I am in my second level Java class and I had problems with arays and multidimensional arrays - truly, you broke it down soooooooo easily. I wil follow you forever my man. Thanks again.
    GW
    Kennesaw State U.

  • @MrSeinfeldFan2
    @MrSeinfeldFan2 8 ปีที่แล้ว

    Excellent teaching. Incredible that you did this in 2009 and yet, still so useful! Thank you!

  • @odo432
    @odo432 12 ปีที่แล้ว

    Both. I build the program(s) in eclipse while watching the videos and pause to take notes. I have a really horrid memory so taking notes while building the program helps me remember and better understand what I am doing. It also helps when I wish to look over them in the future instead of having to rely on skipping through the videos and finding it.

  • @abfrische
    @abfrische 12 ปีที่แล้ว +1

    Wuhuu, had a lil struggle understanding this at first, but after going through it one step at a time, it all makes perfect sense :D I bet you all know what kind of sensational feeling I'm talking about ^^ Thanks so much for these tuts Bucky :)

  • @BigyetiTechnologies
    @BigyetiTechnologies 8 ปีที่แล้ว +60

    Can I hear birds tweeting in the background?

    • @GraverFILMS
      @GraverFILMS 7 ปีที่แล้ว +12

      I read that as twerking for a second lol

    • @pkgamma
      @pkgamma 7 ปีที่แล้ว +6

      yeah those are called twitters

  • @Saladon89
    @Saladon89 14 ปีที่แล้ว +1

    man had to watch this many times to fully get it, but great tutorial

  • @hazellincons
    @hazellincons 2 ปีที่แล้ว

    thank you all, sir and ma'am and Mr. Boston. You are all great teachers

  • @MarcCentanni
    @MarcCentanni 7 ปีที่แล้ว +35

    Yo dawg, we put an array in your array so you can array while you array

  • @MrClinton82
    @MrClinton82 11 ปีที่แล้ว +5

    Bucky is at the top of my list for tutorials. A text version of this is H&L uk google it its awsome equivalent to Bucky. Books 1st Beginer Java for dummies then head first java and then java patterns. Start with Bucky. Important to use all resources even if your going over the same material especially if your going over the same material Bucky dosent explain everything. But does the best vid tutorials in my opinion.

    • @IrakliKhakhviashvili
      @IrakliKhakhviashvili 11 ปีที่แล้ว

      i can't find java patterns in google, can you name the book more precisely?

    • @MrClinton82
      @MrClinton82 11 ปีที่แล้ว

      Head Start Pattern and for You tube check out Derek bana java he really covers a lot.

    • @IrakliKhakhviashvili
      @IrakliKhakhviashvili 11 ปีที่แล้ว

      thanks, i'll check that out

    • @dnangel4277
      @dnangel4277 6 ปีที่แล้ว

      Head First Java is a great book for beginners in Java :)

  • @francys1426
    @francys1426 12 ปีที่แล้ว

    i took java introduction to programming it went great and finished
    but i wanted to expend my knowledge and got here
    i really enjoy your videos thanks for the help!

  • @twitterstime
    @twitterstime 11 ปีที่แล้ว +8

    You're a great teacher, thank you for this!

  • @ReveanceFX
    @ReveanceFX 14 ปีที่แล้ว

    @HammockerSam
    Better explenation (soz for bad explanation in earlier posts):
    Your in the first for loop: row = 0;
    Your in for loop in the for loop: row still 0 because it hasn't incremented yet;
    at that moment x[row].length equals x[0].length, which means, the length of the numbers that are in the first array. Now it has that number (for example 10) it knows that it should make that many colums.
    after that it's gonna restart the loop, and this will go on until row

  • @markopolo6767
    @markopolo6767 11 ปีที่แล้ว

    since x is a multidimensional array, x.length refers to how many arrays are in x. In the case of {{1,2,3},{4,5,6}} x.length would be 2
    (0 and 1) because there are two arrays. x[row].length refers to how many numbers are in an array in a multidimensional array. Hope this helps!

  • @Saxpwner
    @Saxpwner 13 ปีที่แล้ว

    These videos are all delicious! They keep getting better. I think you've made a programmer out of me, Bucky. I also love how you just throw the code out there while you are teaching. It is so easy to understand that way. P.s keep making reusable code like this that passes things to methods to be processed. Me gusta.

  • @urbansilhouettemedia
    @urbansilhouettemedia 12 ปีที่แล้ว

    -> Loopception, Taking notes is something nobody likes to do, but you are right it is necessary. I knew that I should have been taking notes by Lec. 3. Here I am on 34. I have written four small Java programs by now and I still have to refer back to things as simple as the for loop video, to get any thing done. I think that i am going to backtrack tomorrow and jot down the highlights. That way I do not get any further behind. BTW, I am in a Java class in college. Bucky is better.

  • @MrJan994
    @MrJan994 11 ปีที่แล้ว

    Bucky, do not understand this the wrong way. But you are my hero.
    Thank you.

  • @jonnybronson4911
    @jonnybronson4911 7 ปีที่แล้ว

    u got talent in explaining, quality info packed in a minor time frame, keep it up mate)

  • @TheDJRockstar1
    @TheDJRockstar1 12 ปีที่แล้ว +1

    I wasn't doing it until ep 30 where i got confused and started all over again :S now its waaay easier to understand.

  • @manpildo
    @manpildo 12 ปีที่แล้ว

    The int x[][], as far as I understood, is simply to tell what kind of method you're going to use. You can later use that method to place any multi dimensional array in there, so it will place your array values in the x[][]= method. When you look at for example "display(firstarray);".. it just takes the values of the firstarray and places it in the display method, so x[][] will equal exactly what your firstarray equals. It will do the method calculations and display it in a modified style.

  • @PavelescuRazvan
    @PavelescuRazvan 11 ปีที่แล้ว +5

    5:38 I can hear birds singing, awesome!

  • @noypearl3495
    @noypearl3495 8 ปีที่แล้ว

    Very nice video. I have a test tomorrow and it helped me understand better about looping through 2d array in Java.

  • @gumball135
    @gumball135 11 ปีที่แล้ว

    What Krazy92 said. The reason it saves us time is that it means we don't have to write out a new piece of code every time we want to print an array. If you have 100 arrays and you want to print them all out, it's easier to type:
    display(array1);
    display(array2);
    etc.
    ...rather than typing out two for loops and a few print statements every time.

  • @HotelMikePapa3
    @HotelMikePapa3 6 ปีที่แล้ว

    Thanks dude your explanations on MultiDimArrays was elightening!

  • @saadlulu
    @saadlulu 14 ปีที่แล้ว

    wonderful, i never understood mulitdimintional array before, thanks bucky

  • @sonalinarkar101
    @sonalinarkar101 7 ปีที่แล้ว

    love you Bucky.because of u I am understanding how to print multidimensional array

  • @ReveanceFX
    @ReveanceFX 14 ปีที่แล้ว

    @HammockerSam
    Example:
    Your in the loop for the first time, so row=0.
    that means that it's gonna look at x[0] (in this case so it's gonna look at the length of the first array in the multidimensional array (array in array) that you send to the method as x value) Then the method .length will calculate the length of the array, so x[0] will look how many numbers are in the first array of the array, and this is necessary since it needs to know how many numbers to print.

  • @odo432
    @odo432 12 ปีที่แล้ว

    Good thing I'm taking notes and taking my time. I wouldn't understand this if I didn't. 7 minute tutorial in 30-40 minutes lol.

  • @schm0sbyy
    @schm0sbyy 11 ปีที่แล้ว

    The x.length means you're getting the length of the x so in this case for the first array the length of x is 2 because we have two rows. For the second array the length of x is 3 because we have three rows. The x[row].length means you're getting the length of x[row] so for the first loop, it gets the length of x[0], for the second loop, it gets the length of x[1] and so on if there's more than one column in that row. In short x[row].length is used to know the length of column in that row.

  • @TheExtremeDevice
    @TheExtremeDevice 12 ปีที่แล้ว

    Thanks lol helps! TO ALL: IF YOU TYPE syso AND PRESS CTRL AND SPACE AT THE SAME TIME, IT WILL TYPE System.out.println(); FOR YOU ;)

  • @sahand5277
    @sahand5277 10 ปีที่แล้ว +1

    That was amazinggggggggggggg ..thumbs up Bucky!

  • @YathishDhavala
    @YathishDhavala 12 ปีที่แล้ว

    Irrespective of what IDE you use the array elements must be dislplayed in different lines. Because we added an empty line statement : System.out.println(); after the column for loop. you might have forgotten to add this line if you arent getting the rows in separate lines.

  • @YourAppleTechHelp
    @YourAppleTechHelp 15 ปีที่แล้ว

    Starting to get harder :D
    probably have to see some of the videos twice to understand and remember it;)
    great tutorials!

  • @GPROJify
    @GPROJify 13 ปีที่แล้ว

    why thenewboston is far superior to school: the newboston has succeeded to teach 80,000 people things that school failed to teach about 30.

  • @padredoom
    @padredoom 12 ปีที่แล้ว

    A couple good practice tips: Change your arrays and method to display strings instead of integers, and call the display method from a different class (I used the tuna class we created way back when).

  • @CyanGekko
    @CyanGekko 12 ปีที่แล้ว

    say if string x = "x" and string y = "y", to compare the two for EXACTness, you would use:
    if(x.equals(y)){}
    the above would be case sensitive, and if you don't want it to be case sensitive, you can use this:
    if(x.equalsIgnoreCase(y){}
    hope this helps!

  • @iliasoumarri9282
    @iliasoumarri9282 9 ปีที่แล้ว +1

    bucky thanks that's sooo helpfull ..just one note ..for method Display Line 16..exact..[System.out.print(x[row][column]+"\t");]
    U didn't mention that "println" must be "print" ..just for viewers who didn't notice.

  • @nadiag5836
    @nadiag5836 7 ปีที่แล้ว

    literally you have been helping me pass comp sci LOL

  • @evanmastermind
    @evanmastermind 10 ปีที่แล้ว +51

    This was Bucky's most confusing tutorial so far! :(

    • @evanmastermind
      @evanmastermind 10 ปีที่แล้ว +4

      I am looking forward!! :)

    • @leep3488
      @leep3488 10 ปีที่แล้ว +7

      ***** For newbies this is a tough concept to grasp. Especially the for statement is confusing. You have to practice this concept to fully understand it.

    • @pigking1079
      @pigking1079 10 ปีที่แล้ว

      If you have previous programming experience then it is easy, other wise it is hard. I have learned 2 and a half programming languages before so it is very easy for me.

    • @bibleebob
      @bibleebob 9 ปีที่แล้ว +12

      PigKing107 And a half? lol

    • @evanmastermind
      @evanmastermind 9 ปีที่แล้ว +13

      Looking back, I can't believe I thought this was "confusing". I was such a noob then..

  • @kennethbgoodin
    @kennethbgoodin 11 ปีที่แล้ว

    No. x.length refers to the number of rows, and x[row].length refers to the number of elements in the specified row.

  • @karan_2892
    @karan_2892 12 ปีที่แล้ว

    before today I always found multi dimensional array complicated !!
    buck u rock !!

  • @lamsaodaydaica
    @lamsaodaydaica 11 ปีที่แล้ว

    x.length means the length of the array. You can write it as row

  • @obelix7349
    @obelix7349 7 ปีที่แล้ว

    One small advice to people, if you are just watching the videos, i think it would help if you have eclipse in the background and type out the code what bucky is doing and run the program yourself, in that way it gets less boring and you will be able to learn more as well as stick to the whole series, you would easily get bored if you prefer only watching these...

    • @gaminghighlightsmontages1496
      @gaminghighlightsmontages1496 7 ปีที่แล้ว +1

      Thats what i do. I have two monitors, the main monitor has the tutorial running while my second has eclipse open in which im following along with the tutorial.

  • @SheepIn6Flavors
    @SheepIn6Flavors 12 ปีที่แล้ว

    It's an argument that says "this function needs a nested array in order to work". It's a placeholder for you to send a nested array into that function. The "x" is just a generic name for that argument -- you could call it int potato [][] or int vietnameseProstitute [][] if you wanted. The brackets -- [] -- indicate it's an array. The number of bracket pairs indicate arrays nested inside of one another, like those Russian dolls you open up and find littler dolls in.

  • @TheTh3One
    @TheTh3One 12 ปีที่แล้ว

    He use length, because the multi array does not have a "nxn" size or a "nxm" size, so the program must know until how far it goes in each row.As you can see, in the program, the "firstarray" has 2 rows and each row has 4 columns, a 2x4 size. But in the "secondarray" he has 3 rows but in the 1st and 2nd row are different number of columns, in the 1st are 4 columns meanwhile in the 2nd is just one. So that is why he needs to use the "length".
    I hope that this helps!

  • @nguyennguyenkn
    @nguyennguyenkn 15 ปีที่แล้ว

    I like your java tutorials, Bucky. I learned a lot.

  • @ReveanceFX
    @ReveanceFX 14 ปีที่แล้ว

    @HammockerSam This is because the 'row' in 'x[row]' is gonna increase with 1 in every loop, as you know increment. because the x basically has an array in an array, it means that the row (which starts at 0) is gonna calculate the length (as in 'x[row].length') of the first array, second array, or third array, depending on what the 'row' value is.
    Example in next comment (no space :P)

  • @powerphillg5
    @powerphillg5 14 ปีที่แล้ว

    Hey bucky, knock knock (who's there?)
    You are bucky, you're always there for my Java learning :-)

  • @kreedwd
    @kreedwd 14 ปีที่แล้ว

    i wish you lots of luck bud, these tutorials are phat!!

  • @nextblain
    @nextblain 12 ปีที่แล้ว

    well, writing x[][] simply means that we are telling the system that we declared a two dimensional array, that is [] followed by [], we can also type in exactly how many rows or columns we need the system to allocate, like x[2][3], so yeah thats what it means :)

  • @JPSANDHU008
    @JPSANDHU008 12 ปีที่แล้ว

    ya i figured that out as I progressed,,,Arrays and lists are discussed in Detail in his Intermediate tutorials,,thanks

  • @tkwkV0
    @tkwkV0 12 ปีที่แล้ว

    @ShaneCopseysTV Chill man, I didn't say they're not usefull, I said I dind't know how will they be usefull. Probably cause I've never tried to make a full program.... tht's why I'm here.
    Now I know one scenario thanks to you.

  • @lfroggyl
    @lfroggyl 14 ปีที่แล้ว

    @LeloDelatino this concept is just so full of win

  • @TeamCorder
    @TeamCorder 13 ปีที่แล้ว

    Love the chirping birds in the background!

  • @habtamusium8646
    @habtamusium8646 ปีที่แล้ว

    Very happy by learning this lesson ! many thanks

  • @lauralicia457
    @lauralicia457 10 ปีที่แล้ว

    Thanks this really cleared up my doubts, your tutorials are awesome! Keep it up!

  • @Lagahan
    @Lagahan 10 ปีที่แล้ว

    Thanks, ya did a helluva lot better of a job explaining this than my lecturer did!

  • @TheBeautyofTrance
    @TheBeautyofTrance 12 ปีที่แล้ว

    If I understand what you're saying correctly, then yes. Imagine a multi-dimensional array like a table.
    if we have the array called 'letters':
    a-b-c-d
    e-f-g-h
    i-j-k-l
    the character 'j' would be letters[2][1]. The first column is 0, the second 1, the third 2. 'h' would be letters[1][3].

  • @patrickstarfish579
    @patrickstarfish579 9 ปีที่แล้ว

    correct me if im wrong guys based on my understanding
    on the loop statement
    bucky just made public static void display(int x[][]) then this programs expect an array
    for(int row = 0;row < x.length;row++){
    for(int column = 0; column < x[row].length;column++){
    System.out.print(x[row][column]+"\t");
    }
    System.out.println();
    by the way int x represent the 1st array list as a sample
    for the 1st loop says int row will get every array that there is by 1 in length
    after the loop is done now our row have a value then proceed to next step
    then for the nested loop which is column if column is less than x[row].length
    which our row with the list of array in length remember we have 2 array index in our first array so after getting the 1st index and the 2nd we tell the program to
    System.out.print(x[row][column]+"\t");
    then
    System.out.println();
    did i get it right?

  • @MegaJakeroo
    @MegaJakeroo 12 ปีที่แล้ว

    The "(int x[][])" means that, when you run the method, you can't just type, "display()", you have to add an integer multidimensional array in the parentheses.

  • @kinagatnangsevenlion4325
    @kinagatnangsevenlion4325 10 ปีที่แล้ว +7

    can anyone please tell me what the problem is, i got the output in my console with this pattern:
    This is the firstarray
    2
    4
    6
    8
    10
    12
    14
    16
    This is the secondarray
    31
    32
    33
    34
    45
    22
    23
    12
    i did the same thing as bucky did in the tutorial. hope u can help me guys thanks!

    • @kinagatnangsevenlion4325
      @kinagatnangsevenlion4325 10 ปีที่แล้ว +1

      can anyone tell me what is/are the error/s with this one?
      class apples {
      public static void main(String args[]) {
      int firstarray[][]={{2,4,6,8},{10,12,14,16}};
      int secondarray[][]={{31,32,33,34},{45},{22,23,12}};
      System.out.println("This is the first array");
      display(firstarray);
      System.out.println("This is the second array");
      display(secondarray);
      }
      public static void display(int x[][]){
      for(int row=0;row

    • @meesie1
      @meesie1 10 ปีที่แล้ว +1

      kinagatnang sevenlion I have the same

    • @lxnatsuxl
      @lxnatsuxl 10 ปีที่แล้ว +15

      kinagatnang sevenlion check his code at line 16 and compare it to yours. he wrote System.out.print(x[row][column]+"\t"); but you wrote System.out.println(x[row][column]+"\t"); ..... "println" means each number/element will be printed on the next line, but "print" means each number will be printed on the same line. I hope this helps..

    • @kinagatnangsevenlion4325
      @kinagatnangsevenlion4325 10 ปีที่แล้ว +2

      lx natsu xl yeah it works. thanks for the help! hope i can ask u more questions about java coz i like to learn more about it but anyway thanks a lot.

    • @parthsarathiverma1726
      @parthsarathiverma1726 10 ปีที่แล้ว

      lx natsu xl thnx alot

  • @BeerLabelBuilder
    @BeerLabelBuilder 11 ปีที่แล้ว

    First for loop counts how many arrays you have (making the index)
    Second for loop processes the numbers in each array

  • @TheBeautyofTrance
    @TheBeautyofTrance 12 ปีที่แล้ว

    also, for your comment about the scanner and strings, you can't compare strings with the "=" sign. You can only use string.equals() or string.equalsIgnoreCase() to check for equality.

  • @gauravdawg
    @gauravdawg 12 ปีที่แล้ว

    x.length gives the number of rows in the matrix
    x[row].length gives the number of elements in a particular row

  • @Earlosaur
    @Earlosaur 8 ปีที่แล้ว +12

    is your window open? i hear birds chirping.
    i haven't been outside in days.

    • @mngf749
      @mngf749 4 ปีที่แล้ว +7

      wait for 2020. you will wont be outside for ages

  • @kira-ye5xo
    @kira-ye5xo 6 ปีที่แล้ว +1

    thank you !!!!
    that was very Helpful to me

  • @vangarecord
    @vangarecord 11 ปีที่แล้ว

    if row's index is 3 i mean when row=3 (so it has 4 elements) the column

  • @tmecmbtdl
    @tmecmbtdl 7 ปีที่แล้ว

    thanks a million , best tutorial possible !

  • @joelgaiciyadu
    @joelgaiciyadu 6 ปีที่แล้ว +1

    Hello Bucky.
    Wouldn't you make a tutorial video of how to make an integral image (well, I mean table of an original table)?

  • @Xiler6969
    @Xiler6969 10 ปีที่แล้ว +4

    public static void display2DArray(int[][] array) {
    for(int[] x: array) {
    for(int y: x) {
    System.out.print(y+"\t");
    }
    System.out.print("
    ");
    }
    }
    More compact and effecient

    • @OverG88
      @OverG88 9 ปีที่แล้ว

      public static void display2DArray(int[][] array) {
      Arrays.stream(array).forEach(ar -> {
      Arrays.stream(ar).forEach(v -> System.out.print(v + "\t"));
      System.out.println("
      ");
      });
      }
      GET REKT M8! :D

  • @gumball135
    @gumball135 11 ปีที่แล้ว

    (int x[][]) specifies what sort of parameter you have to input into the method.
    Within that method, x is a placeholder name for the array you input. You could also have (double elephant), (String name), or even multiple parameters -
    (int x, int y, int z etc).
    Just say you made a method like so:
    public int calcAverage (int x[]){
    int sum;
    for (int num : x) {
    sum += num;
    }
    return sum;
    }
    Then call the method within your main method...[contd]

  • @TouchTyperPHP93
    @TouchTyperPHP93 12 ปีที่แล้ว

    the array is passed to the display method ....
    e.g. in the first main method the display method is called by typing "display(firstarray);"
    Then, the display method basically changes the name of the firstarray to x.... meaning that x[][] is a copy of the firstarray.... and then the second array when it is called

  • @MojojojoSpaceMonkey
    @MojojojoSpaceMonkey 10 ปีที่แล้ว +5

    I need help. Can anyone explain me this line
    "for(int column = 0; column < x[row].length; column++)" ? The exact problem is that I do not understand what stands for x[row].length ???

    • @ryomasjibeng8343
      @ryomasjibeng8343 10 ปีที่แล้ว +1

      x[row].length is the length of the row

    • @jaybartgis5148
      @jaybartgis5148 9 ปีที่แล้ว +4

      X is just another name given for "first array" or "second array" (depending on which one you were doing). Saying you want to end the loop at the end of the values of x.[row] is another way of saying to loop through the columns

    • @wyattlowery9603
      @wyattlowery9603 9 ปีที่แล้ว +2

      +Jay Bartgis I would just like to thank you for being so supportive in the comments section, you have been helpful to me ever since the first ep 😂

    • @OverG88
      @OverG88 9 ปีที่แล้ว +35

      x[row].length is a length of particular 1D array within 2D array.
      I.e. if we have 2D array like: int blaster[][]={{23,24,36},{76,21},{67,84,75}};
      x[0] is equivalent to {23, 24, 36} array.
      x[0].length would be length of that array.
      x[1].length would be length of {76, 21} array etc.
      He's using x[row].length to determine how much times he's going to loop over particular 1D array.

    • @jackyu3559
      @jackyu3559 9 ปีที่แล้ว +4

      Lazic B. really good answer.

  • @Kurogames
    @Kurogames 13 ปีที่แล้ว

    @stradoodle217 Declare the variables like so: String variablename[][]={{"nope"},{"no","naw"}, {"negative"}};
    Don't forget that the S has to be in capital. Also, your display method will take in as argument a string, so it'll be something like: public static void display (String x[][]).

  • @AntonioMorello93
    @AntonioMorello93 13 ปีที่แล้ว

    @14koder It's called a nested for loop.

  • @DigDugFTW
    @DigDugFTW 8 ปีที่แล้ว

    I believe that instantiating multidimensional arrays as: int firstarray[][] = {{1,2},{3,4}};
    is discouraged. I think it is properly written as: int[][] firstArray = {{1,2},{3,4}};

  • @melellis8804
    @melellis8804 7 ปีที่แล้ว

    Amazing video! This has helped me sooo much :)

  • @MrClinton82
    @MrClinton82 11 ปีที่แล้ว

    @ Treeky in the display method change to print.

  • @ziggymcdougal
    @ziggymcdougal 11 ปีที่แล้ว

    they can be used in games to store multiple values and can be used by typing one word in the script

  • @Genuigr
    @Genuigr 13 ปีที่แล้ว

    Watched this video 5 weeks ago and understood nothing. Began from beginning now, and now I understand!

  • @warabutihum
    @warabutihum 11 ปีที่แล้ว

    Please follow Bucky's code accordingly, double check if the codes are exactly the same as bucky. What I think your problem is
    System.out.print(x[row][column]+"\t");
    instead of
    System.out.println(x[row][column]+"\t");
    take out the "ln" from the print.
    I hope my advise helps.
    Thank You

  • @mohannad8977
    @mohannad8977 9 ปีที่แล้ว +3

    I just want to understand something please ..
    for(int column = 0; column < x[row].length; column++)
    Why did we wrote x[row].length and not x.length ? is not x[row].length is the same of the length of x ?

    • @zoranhacker
      @zoranhacker 9 ปีที่แล้ว +1

      Memo Thunder the way I understood it is x.length is how many rows there is and x[row].length is the length of the specified row meaning how many columns it has

    • @rsencyclopedia
      @rsencyclopedia 9 ปีที่แล้ว

      zoranhacker Yeah after playing with it for a bit I came to the same conclusion.

    • @amikawi
      @amikawi 9 ปีที่แล้ว +1

      Memo Thunder exactly as zoranhacker said. Bucky doesn't explain why you don't want to do x.length, but I'm sure in a later tutorial he will explain it, but either way you know now :3

  • @cooldude10799
    @cooldude10799 11 ปีที่แล้ว

    Started 2 days ago, already on episode 34. And i gotta' tell you, its going pretty well.
    EXCEPT FOR ARRAYS. I can't stand them.

  • @maltager5106
    @maltager5106 11 ปีที่แล้ว

    Yay! I don't know about you guys, but I'm finding this Java stuff pretty easy. Hehe, maybe it's just Bucky.

  • @quintenadms
    @quintenadms 9 ปีที่แล้ว

    Thanks man! Great tutorials ! Helped me a lot..

  • @MikeCOYS
    @MikeCOYS 13 ปีที่แล้ว

    @aiwasen .length is a outside class method for the array. The dot is calling it.

  • @TheBeautyofTrance
    @TheBeautyofTrance 12 ปีที่แล้ว

    he's printing out the x[row][column]. So say for example, the first would print out x[0][0], so the zeroth(first) row and the first number in that row. In the next iteration, it would be x[0][1], so the second number in that row. Then when it finishes that statement, the first loop iterates and it becomes x[1][0], so the second row, first column. then x[1][1], and so on. if you need more help, feel free to let me know :D

  • @thierryking1
    @thierryking1 12 ปีที่แล้ว

    I think its similar to the C++ term "pass by reference". Basically its like the format for when use the method, you need to pass this and only this format into the method for it to work correctly. so the "x" is the variable and the [] [] represents multi array. You need to pass into that method an array similar to that format.

  • @pekwk45
    @pekwk45 12 ปีที่แล้ว

    usually you would know the number of columns for an array.
    Otherwise create a method called size to iterate through the rows and using .length add the number of columns together.

  • @MrSharan1997
    @MrSharan1997 12 ปีที่แล้ว

    Getting harder and harder but I'm not going to give up!