Java Method Reference Tutorial with Demonstration | Java 8 Features

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

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

  • @ThinkConstructive
    @ThinkConstructive  2 ปีที่แล้ว +6

    Method Reference is another interesting feature of Java 8. Sometimes also used as an alternative of Lambda Expressions. In this session all kinds of method references are discussed with examples.
    Kindly watch the complete session and try all the examples to understand it completely.
    Happy learning Java 8 Features.
    Cheers,
    Esha

  • @rohitkarambali779
    @rohitkarambali779 2 ปีที่แล้ว +3

    Nice mam

  • @dubeyankitsarar8084
    @dubeyankitsarar8084 2 ปีที่แล้ว +1

    Mam your teaching of the way is awesome .
    My humble request please make a video on microservices.
    plZ plZ plZ 💞

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

    Amazing video!

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

    Hai Madam,what is the meaning of aribitary object ?

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

      Hello,
      Please refer this (link - stackoverflow.com/questions/23533345/what-does-an-arbitrary-object-of-a-particular-type-mean-in-java-8)
      The fourth kind is where you want to call a method that is an instance method of a parameter passed to the function. With a lambda, there is no problem because you can reference the parameter variable, like this:
      (String someString) -> someString.toLowerCase();
      However, since there is no explicit parameter variable in a method reference, the syntax used instead is:
      String::toLowerCase;
      The compiler takes the "particular type" (String) to reference the functional method (toLowerCase) contained in an "arbitrary object" (the object passed in the parameter). The term "arbitrary object" is used because the actual object passed in the parameter could be different each time the method reference is executed.

    • @priyankrajvansh8428
      @priyankrajvansh8428 10 หลายเดือนก่อน

      @@ThinkConstructive Thank you very much mam,i have been struggling for days to understand how this fourth type worked and how to implement it.I just wrote an example of this type of method reference on my own after reading you comment and i can't thank you enough.Please continue imparting knowledge to the community.Much love and respect to you!!I Hope you have a nice day ahead!!