Java Method References - A Beginner's Guide

Поделиться
HTML-код
  • Опубликовано: 10 фев 2025
  • Discover the power of Java Method References in this beginner-friendly guide! Learn how to write cleaner, more expressive code with this Java 8 feature. We'll cover:
    What method references are and why they matter
    The four types of method references
    Practical code examples for each type
    How method references can boost your productivity
    Whether you're new to Java or looking to level up your skills, this video will help you master method references and improve your coding efficiency. Get ready to simplify your lambda expressions and streamline your functional programming approach in Java!
    🔗Resources & Links mentioned in this video:
    Blog Post: www.danvega.de...
    GitHub Repo: github.com/dan...
    👋🏻Connect with me:
    Website: www.danvega.dev
    Twitter: / therealdanvega
    Github: github.com/dan...
    LinkedIn: / danvega
    Newsletter: www.danvega.de...
    SUBSCRIBE TO MY CHANNEL: bit.ly/2re4GH0 ❤️
  • НаукаНаука

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

  • @mrMarseleene
    @mrMarseleene 6 месяцев назад +1

    I already knew that, but it was nice to make sure that i still had that knowlage!
    always glad to watch your videos

  • @swipped99
    @swipped99 6 месяцев назад +2

    More quality java content is always nice, ty Dan

  • @pacifiquemunzihirwa7054
    @pacifiquemunzihirwa7054 6 месяцев назад +1

    I still remember how Intellij taught me about this feature of Java ! It was the first time i learnt something from an IDE. Great experience 😅

  • @MohamedDernoun
    @MohamedDernoun 6 месяцев назад

    The way you are explaining is fascinating ❤

  • @pip3936
    @pip3936 6 месяцев назад +3

    Hi Dan, can you please make a video about heap and thread dumps. How can we investigate them, which valuable data can we retrieve, and how to operate efficiently with it

    • @static-m-s
      @static-m-s 4 месяца назад

      After "A Beginner's Guide", next one defenetly should be "video about heap and thread dumps". Totally agree! 👍

  • @LAZIO14
    @LAZIO14 Месяц назад

    Thanks! You are TOP!

  • @igorshingelevich7627
    @igorshingelevich7627 3 месяца назад

    Thanks! good examples.

  • @LukeGJPotter
    @LukeGJPotter 6 месяцев назад

    If you're planning on doing more of these Java ones, could you consider a Beginner, Intermediate and Advanced tutorial on Optional. Particularly focusing on refactoring a method that checks for null the old way.

  • @joachimdietl6737
    @joachimdietl6737 6 месяцев назад

    Hey Dan nice vidoes, please show more content about stream processing with spliterator and how to work efficiently in parallel

  • @ahmadiyad2860
    @ahmadiyad2860 6 месяцев назад

    thanks dan

  • @mrowox
    @mrowox 6 месяцев назад +2

    Please create content on ThreadLocal.

  • @housemajaliwa
    @housemajaliwa 6 месяцев назад +4

    5:35 but println is not a static method. Isn't that what you call a bound receiver?

  • @kacpergrabiec
    @kacpergrabiec 6 месяцев назад +1

    Can you make a video about spring websocket (and security)?

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

    Hi Dan, could you look into reactive Java? Ive seen it used alot with Spring.

  • @alexanderbrown1178
    @alexanderbrown1178 6 месяцев назад

    Another great video. Thanks Dan! One thing I'm still puzzling over: Why the :: syntax? If I want to use a method I use the dot operator, like: object.method() and in some other languages, if I want a reference to the method I can just use the dot without calling the method to get a reference to the method, see: object.method. Is there a reason why there's a specific syntax that seems to me to be dedicated to getting a reference to a method, as opposed to using a syntax that is consistent with accessing other properties on an object (the dot operator)? Maybe there is something fundamentally different about accessing method references vs other object properties that I am missing because Java is not my first programming language?

  • @jadabailey2585
    @jadabailey2585 3 месяца назад

    Bit confused, so for the reference to a constructor, this would only work if there is only one constructor in a class? Just trying to understand how it would know if there is more than one.

  • @Reclusive_shayar
    @Reclusive_shayar 6 месяцев назад

    How does using unnamed classes gonna change the current spring boot development ?

  • @AdityaSinghRajput-zq4yn
    @AdityaSinghRajput-zq4yn 2 месяца назад

    can you share you code style formatting file like example.xml

  • @SandipChitale
    @SandipChitale 6 месяцев назад

    Without IDEs to help it make it harder to read the code as the signature of the method is hidden by this syntax. To be fair almost very one uses IDE. Conciseness is not always good. I feel the same way about Java allowing dropping types for lambdas.

  • @johnvoorhees2331
    @johnvoorhees2331 6 месяцев назад

    More streams

  • @haroldpepete
    @haroldpepete 6 месяцев назад +2

    if you're using java 21, why not use a unnamed class, new { ... } and you avoid to write all that bolierplate code

    • @DanVega
      @DanVega  6 месяцев назад +4

      That is a preview feature and while I like using it someone new to Java may not understand how to enable that or care for that matter. It's going to be in preview again in JDK 23 but I love this feature and am absolutely looking forward to it.

    • @haroldpepete
      @haroldpepete 6 месяцев назад +4

      @@DanVega ok i got it, can you do a video about stream or functional interfaces in java? both are interesting topics

    • @hayrullahyasar
      @hayrullahyasar 6 месяцев назад

      @@haroldpepete👍👍

  • @bernardobuffa2391
    @bernardobuffa2391 3 месяца назад

    System.out.println is NOT a static method

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

    I hope you are well. Visiting your channel I have seen your all videos and content are very good but your video SEO optimization is not professional. Perhaps you are busy for managing the channel

  • @eddies.8314
    @eddies.8314 6 месяцев назад +3

    First, mofo.