Java method chaining ⛓️

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024
  • Java method chaining
    #Java #method #chaining
    public class Main {
    public static void main(String[] args) {
    // method chaining = a common syntax for invoking multiple method calls in OOP
    // condense code into less lines
    String name = " bro";
    //name = name.concat(" code ");
    //name = name.toUpperCase();
    //name = name.trim();
    name = name.concat("code").toUpperCase().trim();
    System.out.println(name);
    }
    }

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

  • @BroCodez
    @BroCodez  4 года назад +11

    public class Main {
    public static void main(String[] args) {

    // method chaining = a common syntax for invoking multiple method calls in OOP
    // condense code into less lines

    String name = " bro";

    //name = name.concat(" code ");
    //name = name.toUpperCase();
    //name = name.trim();

    name = name.concat("code").toUpperCase().trim();

    System.out.println(name);

    }
    }

  • @devishhiwarale4907
    @devishhiwarale4907 3 года назад +5

    This channel is really underrated ,keep making those coding tutorials ,lots of love

  • @adeebalaifan8684
    @adeebalaifan8684 2 года назад +1

    Amazing concept

  • @PiDeeLP
    @PiDeeLP 17 дней назад

    easy and clear explanation, thanks!

  • @marxLz
    @marxLz 2 года назад +2

    I'm currently here right now because I discovered that this is one of the topics not covered in the all-in-one version of the video. I think 19 topics are missing there.
    I'm about to finish that 12 hour version tutorial. And starting to grasp and understand some codes, but still need my notes as I try to setup my own coding.

    • @jayz01.
      @jayz01. Год назад

      have you made notes for it all?

  • @BingoGo2Space
    @BingoGo2Space Год назад

    Love your course, bro. BIG BIG LOVE

  • @DSCS_GMLohith
    @DSCS_GMLohith 4 года назад +1

    Loved it

  • @SardorbekPahlavonov
    @SardorbekPahlavonov Год назад

    Thank you

  • @MrLoser-ks2xn
    @MrLoser-ks2xn 2 года назад

    Thanks

  • @udaysaimanoj2117
    @udaysaimanoj2117 2 года назад

    Nice

  • @LudObrzygowiony
    @LudObrzygowiony Год назад

    great

  • @m1troska
    @m1troska 2 года назад +1

    Thank you for your great explanation.
    But by the chained version of the code, does it trim the string first, then touppercase, then concat or is it backwards?

  • @rashmikakelum8803
    @rashmikakelum8803 Год назад

    thank you

  • @abdullahhussein6895
    @abdullahhussein6895 2 года назад

    perfect java teacher🤩

  • @afifkhaja
    @afifkhaja Год назад

    Thanks for this

  • @ibrahimylmaz8378
    @ibrahimylmaz8378 2 года назад

    thanks bro

  • @kemann3815
    @kemann3815 2 года назад

    Greatly appreciated

  • @archerx91x60
    @archerx91x60 4 года назад

    Great video

  • @MrLoser-ks2xn
    @MrLoser-ks2xn Год назад

  • @leviplays7466
    @leviplays7466 7 месяцев назад

    you're the bro

  • @maksimmakarov9541
    @maksimmakarov9541 2 года назад

    hey! thx for video :) one question: methods are executed from left to right?

  • @abuhamza6817
    @abuhamza6817 9 месяцев назад

    Thanks bro

  • @desmiles1567
    @desmiles1567 3 года назад

    Nice one bro

  • @creative-commons-videos
    @creative-commons-videos 3 года назад

    hi, how to limit method chain to some perticular function ? returning this will give all method access, and i am trying to make a routing package where i need to return a chain of method like router.get() here i only want to return get, post and other method but i have many methods in class that all are showing up, i also have applyMiddleware() method that i only want after method is selected but it is showing while accessing router.* anything

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

    bowing deep

  • @gamingcool6190
    @gamingcool6190 4 года назад +1

    Can you make a 2D random terrain generator

    • @BroCodez
      @BroCodez  4 года назад

      I'd love to, but it might be a little advanced for us at this level

    • @gamingcool6190
      @gamingcool6190 4 года назад

      @@BroCodez can do it for me please

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

    on vs aime buddyt

  • @BackTasty
    @BackTasty 3 года назад

    comment

  • @percivalgebashe4376
    @percivalgebashe4376 Год назад

    Nice

  • @sabermmirza
    @sabermmirza 3 года назад

    Great video