Java Magic List Trick

Поделиться
HTML-код
  • Опубликовано: 20 авг 2024
  • Enjoy! :-)
    Thank you for commenting and asking questions.
    Discord server - Where we discuss programming languages and tech - Please use the right channel to your input / question :)
    / discord
    My web site:
    www.codeinvest...
    One.com - Easy web sites
    one.me/daauttew
    The code is located here:
    github.com/eki...
    Follow me on twitter:
    / mikemoelnielsen
    Chat on Discord:
    / discord
    Support me on Patreon:
    / mikemoellernielsen
    Background nature video:
    Video by Engin Akyurt from Pexels
    www.pexels.com...

Комментарии • 6

  • @mykyta1235
    @mykyta1235 5 месяцев назад +2

    anyway, thanks for the Collection's shuffle method reveal. In 7 years didn't even know it exists

    • @MikesTechCorner
      @MikesTechCorner  5 месяцев назад

      You're welcome! :-) There are a lot of unexplored methods. I feel like Indiana Jones when I look at the JDK code.

  • @ievgenmajor3301
    @ievgenmajor3301 5 месяцев назад +1

    ))

  • @mykyta1235
    @mykyta1235 5 месяцев назад +1

    lol man :D This is a java basics. Called an Interface. Interface Describes the way implementing type MUST behave. And this case means interface List just extends original Collection interface "promised" (or described, if you want) functionality that implementing types must provide. It's just a method overloading in the end.
    Why your List interface forces you to use Index-based "remove" method? Because you're giving it a primitive integer value. And List provides extension that basically accepts integer as an argument. And method overloading resolution happens at compile time by the most suitable value you pass.

    • @MikesTechCorner
      @MikesTechCorner  5 месяцев назад

      Yes yes yes. I was just amazed by it. :)