Intermediate Java Tutorial – 11 – Collections Methods fill

///Intermediate Java Tutorial – 11 – Collections Methods fill

Intermediate Java Tutorial – 11 – Collections Methods fill

FavoriteLoadingAdd to favorites

Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –

source

Java468x60
By |2020-02-26T01:57:41+00:00February 26th, 2020|Java Video Tutorials|48 Comments

48 Comments

  1. JameezPlays February 26, 2020 at 1:57 am - Reply

    The reason a simple "=" won't work for the list copy (Collections.copy(listcopy, l)) is because:
    When you write listcopy=l, for some reason, it doesn't copy the letters, only HOW MUCH letters there are, leaving you with a bunch of nulls.
    Collections.copy DOES copy the letters, giving you an exact copy instead of a bunch of nulls.

  2. Raihanur Rahman February 26, 2020 at 1:57 am - Reply

    xxx…mhmmm 😉

  3. Raihanur Rahman February 26, 2020 at 1:57 am - Reply

    xxx…mhmmm 😉

  4. asdweagawas February 26, 2020 at 1:57 am - Reply

    Why do you need an iterator if u can just loop through lists?

  5. Dimitrije Mitic February 26, 2020 at 1:57 am - Reply

    This man literally has tutorials on everything computers. I wish I could understand how one brain can hold so much knowledge. Bucky the demigod of computing! For real tho, you're and inspiration! Thank you for everything!

  6. Xaver February 26, 2020 at 1:57 am - Reply

    2:12 A better letter than "x"? Damn man 🙁

  7. DarkLevis February 26, 2020 at 1:57 am - Reply

    the output method was redundant, you can just use System.out.println(List);
    Good videos nevertheless 🙂

  8. Ebrahimsnow February 26, 2020 at 1:57 am - Reply

    Puberty can be tough Bucky; I get it

  9. tanu1215 February 26, 2020 at 1:57 am - Reply

    can someone explain why we must create an array for "listCopy"?

    Why cant we do something like:

    Character[] ray = { 'p', 'w', 'n' };
    List<Character> i = new ArrayList<Character>(Arrays.asList(ray));

    //and then..

    List<Character> listCopy = new ArrayList<Character>();
    // Copy contents of list into listcopy
    Collections.copy(listCopy, i);

  10. aeon February 26, 2020 at 1:57 am - Reply

    Great job man, best regards from Sweden 🙂 watching this in 2016!

  11. Shamak February 26, 2020 at 1:57 am - Reply

    2:49 "…let's go ahead and tighten this up…"

    You forgot to say "That's what she said"!

  12. Jinhua Chen February 26, 2020 at 1:57 am - Reply

    import java.util.*;

    public class Bucky {
        public static void main(String[] args) {
            Character[] ray = {'p', 'r', 'n'};
            List<Character> l = new ArrayList<Character>(Arrays.asList(ray));
            System.out.println("List is: ");
            output(l);

            Collections.reverse(l);
            System.out.println("After reverse: ");
            output(l);

            Character[] newRay = new Character[3];
            List<Character> listCopy = new ArrayList<Character>(Arrays.asList(newRay));

            Collections.copy(listCopy, l);
            System.out.println("Copy of list:");
            output(listCopy);

            Collections.fill(l, 'X');
            System.out.println("After filling the list: ");
            output(l);
        }

        private static void output(List<Character> thelist) {

            for (Character thing: thelist)
                System.out.printf("%s ", thing);

            System.out.println();
        }

    }

  13. Eshan Patil February 26, 2020 at 1:57 am - Reply

    Is the List ArrayList or LinkedList??

  14. Bob The Zealot February 26, 2020 at 1:57 am - Reply

    I dare you to search xxx on Google Images with safe search off.

  15. Bob The Zealot February 26, 2020 at 1:57 am - Reply

    We can't count? It's you who can't count.

  16. Sharkhead February 26, 2020 at 1:57 am - Reply

    Can someone just give me a hint about this:
    When i use the Enhanced for loop, WITH these >>> {}
    my OUTPUT method shows everything like this:
    p
    w
    n
    But when i do the Enhanced for loop WITHOUT these >>> {}
    it shows like this:
    p  w  n

    My question is, why these {} do this?? Its strange…

  17. Mistermaarten150 February 26, 2020 at 1:57 am - Reply

    Are these list programs very useful?

  18. ScottishSting February 26, 2020 at 1:57 am - Reply

    Without declaring the visibility of a method, it would be default visibility, which is public. However, a good programmer should always declare a method as public or private. Private methods are appropriate for when they only need to be used in the same class. Using private methods to do each step of a more advanced method makes the program much more readable, both by the author and others.

  19. 尤育志 February 26, 2020 at 1:57 am - Reply

    If you don't want to add "static", that's fine. But you need to instantiate and object before you use it. something like bucky b = new bucky(); and b.print("test"); hopefully i answered you questions.

  20. 尤育志 February 26, 2020 at 1:57 am - Reply

    you can totally put "public " or nothing in front of it, it would just make other classes able to use that method. in this case, there's no other class that needs to use that method, so we put private(total up to you). This means there will be an error if other class try to instantiate the bucky.print() method.
    And about static, if we don't need many different objects, we only need to functionality of that method, then we use "static", like the System.out.print method.

  21. 尤育志 February 26, 2020 at 1:57 am - Reply

    "static" means that you don't have to instantiate an new object when you want to use the method, you can use it directly. and private means that this method is only accessible within the class. the opposite is public, a public method can be called from outside the class.

  22. Kehlim The Chip Monk February 26, 2020 at 1:57 am - Reply

    anyone else missed the "that's what she said" at 2:49?

  23. amy sam February 26, 2020 at 1:57 am - Reply

    sometimes i have errors that i cant find out and i keep searching for a long time but it doesnt work i hate that

  24. amy sam February 26, 2020 at 1:57 am - Reply

    they dont look identical in my eclipse

  25. Jonny Lawrence February 26, 2020 at 1:57 am - Reply

    Any one else notice that 1 and l in Eclipse look almost identical?

  26. Alfred696 February 26, 2020 at 1:57 am - Reply

    2:48 – that's what she said! 😉

  27. Adeel Zaheer February 26, 2020 at 1:57 am - Reply

    I vote you for the geek king of the century! Keep up the good job dude! Cheers 🙂

  28. Lawrence Fidelino February 26, 2020 at 1:57 am - Reply

    I'm starting to think that you're misspelling words on purpose. hahaha!

  29. Dennis Joseph February 26, 2020 at 1:57 am - Reply

    Oh my god -_- I spent 15 minutes searching for my error and I had a semi colon after
    for(Character xyz: thelist); <<– that 1.. pff 😛
    System.out.printf("%s ", xyz);

  30. Poseiden Jp February 26, 2020 at 1:57 am - Reply

    the XD sign yours like xD lol 😀

  31. Poseiden Jp February 26, 2020 at 1:57 am - Reply

    hmmmmm…… very religious XD

  32. Kevin Pek February 26, 2020 at 1:57 am - Reply

    His voice sounds wierd ….

  33. xJamspasticx February 26, 2020 at 1:57 am - Reply

    Bucky I would just like to thank you for being the reason I passed my first Java semester xD.

  34. Ngoc Son Dang February 26, 2020 at 1:57 am - Reply

    Thanks Bucky. Yr awesome man. God bless you.

  35. Aaron February 26, 2020 at 1:57 am - Reply

    With the seperate method it is easier because you only have to make one for loop instead of typing in a printf() method multiple times (The explanation probably sucked but I hope it made a little bit of sense 🙂 )

  36. Omar Jesus February 26, 2020 at 1:57 am - Reply

    UMMM

  37. ChainoFate February 26, 2020 at 1:57 am - Reply

    Thank you! you're better than my professor!

  38. Pranav Jain February 26, 2020 at 1:57 am - Reply

    lsit is the new list

  39. adrian popescu February 26, 2020 at 1:57 am - Reply

    very nice tutorials man, ty for making them! cheers 🙂

  40. Faustodc February 26, 2020 at 1:57 am - Reply

    Korean Rap? LOL

  41. nesing81 February 26, 2020 at 1:57 am - Reply

    why write a new output method and not just use a printf() as in tut 10 ?

  42. Jai Rathore February 26, 2020 at 1:57 am - Reply

    xxx

  43. Alexxv46 February 26, 2020 at 1:57 am - Reply

    some are just skippers)

  44. Valcua February 26, 2020 at 1:57 am - Reply

    wut? I had fun 😀

  45. bilbsyy February 26, 2020 at 1:57 am - Reply

    anyone who is learning programming and at the start went oh wow didn't know 10 was before 11 just walk away now…

  46. CraftMiner502 February 26, 2020 at 1:57 am - Reply

    Is it just me or does it skip tut 10 on this playlist?

  47. dasten123 February 26, 2020 at 1:57 am - Reply

    collections are boring 🙁

  48. Frogfish999 February 26, 2020 at 1:57 am - Reply

    can't count…or can't look up…

Leave A Comment

*