Java ArrayList 🧾

Поділитися
Вставка
  • Опубліковано 31 січ 2025

КОМЕНТАРІ • 174

  • @BroCodez
    @BroCodez  4 роки тому +98

    import java.util.ArrayList;
    public class Main {
    public static void main(String[] args) {

    // ArrayList = a resizable array.
    // Elements can be added and removed after compilation phase
    // store reference data types

    ArrayList food = new ArrayList();

    food.add("pizza");
    food.add("hamburger");
    food.add("hotdog");

    //food.set(0, "sushi");
    //food.remove(2);
    //food.clear();

    for(int i=0; i

  • @samiulhussain3045
    @samiulhussain3045 Рік тому +80

    I pay 9k for uni when this guy is better than all my lecturers combined

  • @stevonolandem2712
    @stevonolandem2712 9 місяців тому +10

    Thanks for doing this stuff. I'm an old java programmer, having help usher in Java back in the mid 90s. I've retired and now want to just code for fun and your code examples are a wonderful resource.

  • @amiyoshikawa8626
    @amiyoshikawa8626 2 роки тому +16

    Thank you for this! Your explanations are so clear and concise! I've been struggling on an assignment all week and this video helped me a ton. Appreciate you!

  • @fullyprimed
    @fullyprimed 4 роки тому +38

    Really enjoying your videos! The way in which you break down these concepts is concise, and yields high value for someone studying java for the first time

    • @BroCodez
      @BroCodez  4 роки тому +9

      I'm glad you enjoy them Luc! Thank you for watching

    • @vklmao8677
      @vklmao8677 3 роки тому

      Same is happening here Bro..

  • @MrViutiful
    @MrViutiful 4 роки тому +23

    Thank you for the class.
    That is exactly what I was needing to finish a small exercise.

  • @cesara9747
    @cesara9747 3 роки тому +16

    This is the best Java tutorial ever

  • @mohammadreza1414
    @mohammadreza1414 7 місяців тому +4

    This guy's playlist beats two semesters' worth of university classes.

  • @pavelkvasnicka6856
    @pavelkvasnicka6856 Рік тому

    This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro

  • @caiquecarvalho771
    @caiquecarvalho771 3 роки тому +1

    In love with this channel

  • @rukiruki-eg4kc
    @rukiruki-eg4kc Рік тому

    The second video I watched from your channel so far and its been very straightforward and useful for me. Especially when I'm not very familiar with the concepts. Thanks :)

  • @Simis999
    @Simis999 2 роки тому

    Rarely do you find entertaining content that's pure education

  • @vklmao8677
    @vklmao8677 3 роки тому +1

    This person is an absolute LEGEND....!🤩🤩

  • @nourialsayed
    @nourialsayed 4 роки тому +2

    For now until I finish java courses I am going to support your videos and I will share it with my friends! You deserve more than that RESPECT ✅🙏🏻

  • @freesoftwares6042
    @freesoftwares6042 2 роки тому

    2 years later and i am here once again , i watched this 2 years ago so i can pass my java class , this time its the java advanced course but im trying to remember the basics before going in

  • @ChristianRodriguez-tm3jg
    @ChristianRodriguez-tm3jg 2 роки тому

    Thanks for being so considerated with those who live in countries like Ecuador where teachers (Pseudo professionals) aren't qualified ones. But I want to break that chain. I would like to get the knowledge and master it as you do....! Thanks bro.
    Greetings from Ecuador
    Pd. I am studying the career of software development, Data Structure is my currect class. I will succed thanks to you...!

  • @mohamedDEV123
    @mohamedDEV123 Рік тому +1

    This short video was soo helpfull , thank you from africa

  • @mohammadfarhat3933
    @mohammadfarhat3933 2 роки тому +1

    man you are a legend and a life saver

  • @eeshdesai1362
    @eeshdesai1362 Місяць тому

    man has just saved my life.

  • @mikewinchel6860
    @mikewinchel6860 3 роки тому +7

    Great video, a "for each" loop is also a good option to display all the elements in an array
    for(String f : food)
    {
    System.out.println(f);
    }

    • @Time_to_Wake_Up
      @Time_to_Wake_Up 2 роки тому

      Is there a way to only display "Apples" and not "Bananas" if you know what I mean?

  • @bharathpavurala7817
    @bharathpavurala7817 2 роки тому

    Nobody beats your explanation .. 🥵

  • @mauricio-Bustos
    @mauricio-Bustos Рік тому +1

    Aún sin hablar inglés, puedo entender todo sin usar un traductor. Es tan didáctico y claro al explicar, es uno de los mejores, sino el mejor profesor de Java que hay, no solo en UA-cam sino sino de otras plataformas que también probé. AHORA EN INGLÉS. NOW IN ENGLISH. Even without speaking English, I can understand everything without using a translator. He is so didactic and clear when explaining, he is one of the best, if not the best Java teacher out there, not only on UA-cam but from other platforms that I also tried.

  • @chaithdridi2718
    @chaithdridi2718 4 роки тому +1

    You are doing an amazing job Bro 😍

  • @nikitassouvatzis1928
    @nikitassouvatzis1928 2 роки тому

    Ένα ακόμα χρήσιμο tutorial για τη γλώσσα Java.

  • @dianamilenaarchilacordoba4632
    @dianamilenaarchilacordoba4632 5 місяців тому

    great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much

  • @they_took_my_name
    @they_took_my_name 7 місяців тому

    Thank you mate I needed this

  • @Eagleeye3200
    @Eagleeye3200 Рік тому

    am so happy to know your channel

  • @miuwai6211
    @miuwai6211 3 роки тому

    Excellence. Concise, precise

  • @mohe81
    @mohe81 2 роки тому

    I always get hungry when I watch your tutorials.

  • @tylersamuels4438
    @tylersamuels4438 Рік тому

    Heh that sub highlight at 0:15 is sick

  • @night08755
    @night08755 2 роки тому

    Clear and concise. Thanks a bunch.

  • @Grim_Snark
    @Grim_Snark 6 місяців тому

    Just found this channel today. Currently taking undergrad programming courses as prereqs for a CS Masters program and I gotta say even at a top university the lecture material doesn't hold a candle to this.

  • @hananfadah
    @hananfadah 2 місяці тому

    This was helpful! Thanks!

  • @danielmilewski7659
    @danielmilewski7659 2 роки тому

    wow simple and to the point!

  • @fahrahmn
    @fahrahmn 2 місяці тому

    very helpful

  • @sacredscrollshub
    @sacredscrollshub 8 місяців тому

    Awesome

  • @juanestebanparraparra6302
    @juanestebanparraparra6302 2 роки тому

    Thanks for your videos bro!

  • @gogoi.
    @gogoi. 4 роки тому

    Beautiful explanation. Thanks, I clicked the ads

  • @ghoggaliabdou4222
    @ghoggaliabdou4222 4 роки тому +1

    Thank you again 💙💙💙💙💙💙

  • @BakhtimurodPrimov
    @BakhtimurodPrimov 2 роки тому

    great videos

  • @yellowhellow-wi9gi
    @yellowhellow-wi9gi Місяць тому

    thanks bro you are the best

  • @medjl6083
    @medjl6083 4 роки тому +1

    ArrayList is a dynamic array that contains objects.

  • @daintyleaf
    @daintyleaf Рік тому

    love you, bro!

  • @tinatinzivzivadze6742
    @tinatinzivzivadze6742 3 роки тому +1

    great job!

  • @arthur_p_dent4282
    @arthur_p_dent4282 3 роки тому

    Thanks for the videos.

  • @kathyrag1574
    @kathyrag1574 4 місяці тому

    keep the bro going

  • @kucor01
    @kucor01 4 місяці тому +1

    are there any real life examples on where/when we use each of those methods? I get all of this but still have no idea what are they used for. Or it's too early for that?

    • @shricharansriram5722
      @shricharansriram5722 29 днів тому

      you would use ArrayList when you want a mutable list, like for example adding employees to an ArrayList, you can simply add an input string into the ArrayList instead of creating many arrays

  • @avian8354
    @avian8354 25 днів тому

    💯💯

  • @katiescape
    @katiescape 8 місяців тому

    liked, commented, and subscribed.

  • @MajesticLegend
    @MajesticLegend 3 роки тому

    Amazing

  • @bartomiejsniadach5795
    @bartomiejsniadach5795 2 роки тому

    This was easy. Thank you

  • @justinbanza4751
    @justinbanza4751 3 роки тому

    Thank you for this video

  • @yeliza2350
    @yeliza2350 3 роки тому

    Thank you, Hi from Canada

  • @suryaa5564
    @suryaa5564 4 роки тому +1

    thank you so much bro

  • @shyam.upadhyay
    @shyam.upadhyay 3 роки тому

    I have killed the like button. Thanks bro!

  • @huuloc8719
    @huuloc8719 3 роки тому

    Nice.

  • @omersond4891
    @omersond4891 4 роки тому

    thanks for the class

  • @leiresufran8983
    @leiresufran8983 2 роки тому

    Very good , but why you do not have one using while loops?

  • @oguzoguz4686
    @oguzoguz4686 2 роки тому

    YOU ROCK!

  • @SleepyAizawa69
    @SleepyAizawa69 Рік тому

    Nice bro

  • @firdaus135
    @firdaus135 3 роки тому

    nice

  • @cristianberisha6505
    @cristianberisha6505 4 роки тому +1

    Is there any place we could practice these through maybe exercises?

  • @曾毓哲-b1t
    @曾毓哲-b1t Рік тому

    Thank you very much

  • @aliaskararzykulov2361
    @aliaskararzykulov2361 3 роки тому

    well done

  • @B0bTheSkull-Bonea
    @B0bTheSkull-Bonea 10 місяців тому

    Breaking the algorithm for you!

  • @certifiedsmartass4122
    @certifiedsmartass4122 Рік тому

    Thank you bro!

  • @kemann3815
    @kemann3815 3 роки тому

    Excellency ❤

  • @jaylordjl6337
    @jaylordjl6337 3 роки тому +1

    Can you make a insertion using arrayList? Like asking the user to input string or integer value and stores?

  • @JuliHoffman
    @JuliHoffman 2 роки тому

    Nice! Thank you!!

  • @coroteflavors
    @coroteflavors 4 роки тому

    Thx for the vid bro!

    • @BroCodez
      @BroCodez  4 роки тому

      thanks for watching Higgs!

  • @johncusack4730
    @johncusack4730 5 місяців тому

    Thank you !

  • @editIQYT
    @editIQYT 2 роки тому

    One question : At what time should I be using array and not arraylist and vice versa ?

    • @Toothless_Rides
      @Toothless_Rides Рік тому

      0:30 (approximately). Bro explains why he's using an ArrayList. An "Array" is the opposite...

  • @cdjosh3568
    @cdjosh3568 4 роки тому +2

    I saw another vid on ArrayList where the guy didn't specify the data type and it worked, is it okay to do it that way or is it preferred to declare a data type? Here is an example: ArrayList list = new ArrayList();

    • @BroCodez
      @BroCodez  4 роки тому +2

      Yes, that would be valid as well. I avoided writing the ArrayList that way because doing so will give you an annoying warning unless you suppress it. I though it would lead to some confusion

    • @cdjosh3568
      @cdjosh3568 4 роки тому +3

      @@BroCodez thanks boss

  • @danny.3036
    @danny.3036 3 роки тому

    Thanks, Bro! ☕

  • @eugenezuev7349
    @eugenezuev7349 9 місяців тому

    that's a useful tool

  • @rose4285
    @rose4285 Рік тому

    Thank you!!!

  • @_Enzhaym
    @_Enzhaym 2 місяці тому +1

    hey is it possible to append list like in python

  • @TERTO1402
    @TERTO1402 Рік тому

    Thank you BRo

  • @liliacfury
    @liliacfury 4 роки тому

    Are normal arrays classes too?

  • @empereur52
    @empereur52 Рік тому

    Why u used size instead of length?

  • @har8haroutunian572
    @har8haroutunian572 4 роки тому +1

    Can u send all ur java files thru github so we can study them?

    • @BroCodez
      @BroCodez  4 роки тому +1

      I post the code in the comments for convenience:
      import java.util.ArrayList;
      public class Main {
      public static void main(String[] args) {

      // ArrayList = a resizable array.
      // Elements can be added and removed after compilation phase
      // store reference data types

      ArrayList food = new ArrayList();

      food.add("pizza");
      food.add("hamburger");
      food.add("hotdog");

      //food.set(0, "sushi");
      //food.remove(2);
      //food.clear();

      for(int i=0; i

  • @momen_elagizy
    @momen_elagizy 28 днів тому

    thanks man

  • @tukkinum
    @tukkinum 3 роки тому

    Thanks!

  • @ibrahimylmaz8378
    @ibrahimylmaz8378 2 роки тому

    thanks bro

  • @cristiangarciaperez7230
    @cristiangarciaperez7230 2 роки тому

    what does it mean by i < food. what is food?

  • @soumelee5661
    @soumelee5661 2 роки тому

    nice vid

  • @TmChumT
    @TmChumT 4 місяці тому

    thank you

  • @matinmonshizadeh
    @matinmonshizadeh 3 роки тому

    thanks Bro

  • @isdmg4129
    @isdmg4129 3 роки тому

    Thanks.

  • @adityaalshi7081
    @adityaalshi7081 3 роки тому

    🙌

  • @helpfultools2572
    @helpfultools2572 4 роки тому

    I subscribed you

  • @fatih-fx1gi
    @fatih-fx1gi 2 роки тому

    Can you tell me how to get ArrayList size without using size ()?

  • @bashircodes
    @bashircodes 4 роки тому

    Thanks

  • @cornmoss638
    @cornmoss638 3 роки тому +3

    For some reason Java will not import or reconize this as an import or something, can you review my code? Is there something wrong?
    import java.util.ArrayList;
    public class ArrayList {
    public static void main(String[] args) {
    ArrayList food = new ArrayList();

    }
    }

    • @lauraborghijs3168
      @lauraborghijs3168 3 роки тому +3

      It's because you use 'ArrayList' as your class' name. You can't do that, just refactor it to 'ArrayLists' or something

  • @samankucher5117
    @samankucher5117 2 роки тому

    thank you:)

  • @jensendiecast2385
    @jensendiecast2385 Рік тому

    how would you make it display a random item from the list?

  • @deltaf8704
    @deltaf8704 2 роки тому

    Ofigenno

  • @bekturasanbekov1979
    @bekturasanbekov1979 Рік тому

    thx 4 vid bro !

  • @arailymmeshitbayeva9412
    @arailymmeshitbayeva9412 4 роки тому +1

    Bro, thx)

  • @kirillutsenko9306
    @kirillutsenko9306 2 роки тому

    thx a lot