Java methods 📞

Поділитися
Вставка
  • Опубліковано 13 жов 2024
  • Java methods tutorial explained
    #java #methods #tutorial
    public class Main {
    public static void main(String[] args) {
    // method = a block of code that is executed whenever it is called upon
    int x = 3;
    int y = 4;
    int z = add(x,y);
    System.out.println(z);
    }
    static int add(int x, int y) {
    int z = x + y;
    return z;
    }
    }

КОМЕНТАРІ • 173

  • @BroCodez
    @BroCodez  4 роки тому +63

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

    // method = a block of code that is executed whenever it is called upon

    int x = 3;
    int y = 4;

    int z = add(x,y);
    System.out.println(z);
    }

    static int add(int x, int y) {

    int z = x + y;
    return z;

    }

    }

    • @martiananomaly
      @martiananomaly 3 роки тому

      booba

    • @luchesegarlini
      @luchesegarlini 2 роки тому

      thanks mate!

    • @mst736
      @mst736 10 місяців тому

      public class Main{

      // method = a block of code that is executed whenever it is called upon

      public static void main(String[] args) {

      String name = "Bro";
      int age = 21;

      hello(name,age);

      }

      //void method

      static void hello(String name, int age) {

      System.out.println("Hello "+name);
      System.out.println("You are "+age+" old.");
      }




      } Here you have the void method example master Bro provided. Best Regards.

  • @stickydamper
    @stickydamper 3 роки тому +119

    More people should know about this series. By far the best I have seen on you tube.

    • @FelipeDiaz-tt3zj
      @FelipeDiaz-tt3zj 3 роки тому

      I need help, how should I use this tutorial.
      Should I look at the video and then copy it into the java, or at the same time as the video to do it?

    • @stickydamper
      @stickydamper 3 роки тому +6

      @@FelipeDiaz-tt3zj Every person has a different method. What I do is to watch and type the code side by side. I pause it in the middle, write code and may be play with it and see what else can be done with that. I never copy the code, that works for me. Generally when I am learning a new language, I already start with a project in my mind and then watch the tutorials for straight many hours, get the syntax and start working on the project. Then I keep coming back when I need to.

    • @cezarycezar2819
      @cezarycezar2819 9 місяців тому

      +1

  • @mohamadnazirissumalgy3699
    @mohamadnazirissumalgy3699 4 роки тому +12

    Bro, you're the best.
    Your job is priceless!

  • @pavelkvasnicka6856
    @pavelkvasnicka6856 Рік тому +5

    This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro

  • @shyam.upadhyay
    @shyam.upadhyay 2 роки тому +17

    "It doesn't matter what you do."
    -- Bro

  • @raspberrybabe27
    @raspberrybabe27 Рік тому +11

    these videos are saving my butt. I've been so lost in my coding class and you explain these concepts so simply but clearly. Thank you!

  • @yousefsammar176
    @yousefsammar176 5 місяців тому +3

    I have an exam in 12 hours and these videos will save me
    Thx bro

  • @Acid15ful
    @Acid15ful 2 роки тому +4

    I can count on you to get me thru the boot camp I'm currently in. Appreciate you bro!

  • @mummahadarsal3739
    @mummahadarsal3739 2 роки тому +3

    Sir You are a great teacher i swear the way u explains things are just mind blowing thank u for such type of playlist

  • @TheMurdok77
    @TheMurdok77 6 місяців тому

    I watch your videos religiously, they're the best on UA-cam.

  • @DevWithEv
    @DevWithEv 2 роки тому +1

    Super useful for beginners like me. Thanks Bro! Happy 2022

  • @gamerkiplaysss
    @gamerkiplaysss 2 роки тому +1

    amazing personality, love your channel!

  • @abhijaiallgamesgamer2075
    @abhijaiallgamesgamer2075 4 місяці тому +3

    I AM YOUR SAVIOUR (i commented and saved you)

  • @timaya6
    @timaya6 Рік тому

    You are so incredibly good at explaining. I wish you were my Tutor. I learned so much from your channel already. Im so grareful i found you. You are truly the best

  • @honoredegg
    @honoredegg 2 роки тому +1

    Methods understood completely, 2d ArrayList used as example. 22th. Thank you, ma Bro Sensei!

  • @jojovstojo
    @jojovstojo Рік тому +5

    More detailed code of the provided lesson:
    *********************************************
    public class Main {
    // method = a block of code that is executed whenever it is called upon
    // Since we are calling the add(int, int) function inside the main() method which is a STATIC method, therefore, we also need to make the add() method STATIC.
    static int add(int x, int y) {

    int z = x + y;
    return z;
    }
    // In the above function definition, (int x, int y) are called parameters.

    // Since we are calling the hello(String, int) function inside the main() method which is a STATIC method, therefore, we also need to make the hello(String, int) method STATIC.
    static void hello(String name, int age) {
    System.out.println("Hello "+name);
    System.out.println("Your age is "+age);
    }
    // In the above function definition, (String name, int age) are called parameters.

    // Driver Code:
    public static void main(String[] args) {

    int x = 3;
    int y = 4;

    // Calling method add(int , int)
    int z = add(x,y);
    // In add(x,y), x & y are called arguments.
    // z = 7
    System.out.println(z);

    // Calling method hello(String, int)
    hello("Pritam", 25);
    // Hello Pritam
    // Your age is 25.
    // In hello("Pritam", 25), "Pritam" & 25 are called an arguments.
    }
    }
    // Important Difference Between Argument and String.
    //*************************************************
    // The values that are declared within a function when the function is called are known as an argument. Whereas, the variables that are defined when the function is declared are known as a parameter.

    • @DrEggCake
      @DrEggCake 9 місяців тому

      thanks i needed this im watching this same video for the 6th time because i forget what method arguments and parameters every time

  • @dianamilenaarchilacordoba4632
    @dianamilenaarchilacordoba4632 Місяць тому

    great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much

  • @slade8863
    @slade8863 2 роки тому

    Random comment to appreciate this wonderful video, God Bless you man

  • @Podcast_Walahm
    @Podcast_Walahm Місяць тому +1

    "Bro" Why are yo so good in explaining ?

  • @chaithdridi2718
    @chaithdridi2718 3 роки тому +5

    You are doing an amazing job Bro 😍

  • @rishenxb1s705
    @rishenxb1s705 Місяць тому

    I must say 3 years later and this video aged like fine wine

  • @oguzoguz4686
    @oguzoguz4686 2 роки тому +1

    I loved the Z trick. They did not teach that in the bootcamp. It is very simple thanks

  • @victortruong1524
    @victortruong1524 Рік тому

    Holy shit ! Take my hand Master :(( !!! I have 5 videos about this topic, but you have lightened my understanding

  • @medjl6083
    @medjl6083 3 роки тому +3

    The method in programming, allows you to reuse the code.

  • @g6z19
    @g6z19 2 роки тому +2

    You're actually really helpful thank you :)

  • @shriyarastogi1-jv1mf
    @shriyarastogi1-jv1mf 2 місяці тому

    Thanks bro! you're blessing for us...

  • @mehranabbasi8248
    @mehranabbasi8248 Рік тому

    Amazing, I don't know how to thank you for your wonderful method of teahing. This is what I wanted for my kid to learn Java, Easy and very Practical.
    Thank you very much!

  • @fryingpanm6977
    @fryingpanm6977 4 місяці тому

    i am saving this channel. so i am a hero

  • @dawidmateuszbudkiewicz4938
    @dawidmateuszbudkiewicz4938 3 місяці тому

    This is like the 10th time brocode helped me and i'm just getting started!

    • @txfu-
      @txfu- Місяць тому +1

      ikr

  •  4 місяці тому

    Bro code! Great concept! Thanks for the lessons, bro. 😎

  • @zahidbond
    @zahidbond 2 роки тому

    Bro you are breathtaking🙇‍♂

  • @Kd12334
    @Kd12334 5 місяців тому

    I was trying to understand this for 2 hours today from various sources, but it seems i just needed this video🎉

  • @kirillutsenko9306
    @kirillutsenko9306 2 роки тому

    thx a lot for your job

  • @nikitassouvatzis1928
    @nikitassouvatzis1928 2 роки тому

    Οι μέθοδοι σε κάθε γλώσσα αντικειμενοστρεφούς προγραμματισμού, είναι πολύτιμες!

  • @theximera13
    @theximera13 Рік тому

    pretty comprehensive explanation, thanks!

  • @ardcodelover
    @ardcodelover Рік тому

    Realy outstanding

  • @sakalansnow6579
    @sakalansnow6579 Рік тому

    great job

  • @diegocatez7181
    @diegocatez7181 2 роки тому

    Cool!👍 Hope you already got static explain))

  • @曾毓哲-b1t
    @曾毓哲-b1t Рік тому

    Thank you very much

  • @anjapietralla5767
    @anjapietralla5767 9 місяців тому

    I already learnd so much thank you

  • @yousifshm
    @yousifshm 2 роки тому

    thanks Allah that i know your seriuse, you are a true legend bro!

  • @HamedAthari
    @HamedAthari 2 роки тому

    love your teaching

  • @rownakmallick2426
    @rownakmallick2426 6 місяців тому

    great video!!

  • @bartomiejsniadach5795
    @bartomiejsniadach5795 2 роки тому

    Now it is so simple. Thank you

  • @SodiqjonNomonjonov-y9n
    @SodiqjonNomonjonov-y9n Рік тому

    thank you for this course.

  • @dllm3tommy741
    @dllm3tommy741 Рік тому

    Thanks for the video

  • @ahmadfares324
    @ahmadfares324 2 роки тому

    my fellow bro, you are awesome❤

  • @technicalresi5451
    @technicalresi5451 8 місяців тому

    Very nice bro 😊❤

  • @marcosdidierdrogbachagaslo286

    identico ao conceito de "codar modularizado em python", that's cool!

  • @ligdjumvidja8294
    @ligdjumvidja8294 6 місяців тому

    Brilliant video thanks a lot !

  • @jaylordjl6337
    @jaylordjl6337 3 роки тому

    We’re hoping bro that you can upload a tutorial that java connects to DB :) thankyou

  • @fredericoamigo
    @fredericoamigo 2 роки тому

    Good content a usual. Keep up the good work!

  • @NicholasGJeria
    @NicholasGJeria 12 днів тому

    I still don't understand, you could have just done
    public static int add1(int x, int y) {
    System.out.println(x + y);
    return x + y;
    }
    and write less code? or is the meaning of the return keyword to actually store values in a new variable to use it for something else?

  • @samirkarki8880
    @samirkarki8880 Рік тому

    "Wow, this coding video is absolutely fantastic! I've been following this channel for a while now, and I must say, you have been a tremendous help in clearing my doubts and enhancing my coding skills. I even watched your Python tutorial videos, which made a world of difference for me. The explanations are clear, concise, and far more engaging than what I've experienced in my university courses. Thank you so much for providing such valuable resources and making coding accessible and enjoyable for learners like me. Keep up the excellent work!"

  • @richardnunley7681
    @richardnunley7681 8 місяців тому

    This helped me so much thank you!

  • @cesara9747
    @cesara9747 2 роки тому

    master of the universe!

  • @MrLoser-ks2xn
    @MrLoser-ks2xn 2 роки тому

    Thanks

  • @ktos2144
    @ktos2144 2 роки тому

    You are very nice teacher! I will listen you in your next films ^^ Maybe I don't know english so perfect but I can understand you. It's very nice :D

  • @moumenzineb6672
    @moumenzineb6672 Рік тому

    Thank you so much bro, amazing job

  • @ardcodelover
    @ardcodelover Рік тому

    Good sir

  • @anatolisavin3155
    @anatolisavin3155 3 роки тому +1

    will you ever teach spring ?

  • @12bradleyd
    @12bradleyd 3 роки тому

    Super helpful videos! Thanks for making these

  • @nirnoychatterjee7908
    @nirnoychatterjee7908 Рік тому

    Please suggest projects in java to increase my hold in java

  • @saeedajax4764
    @saeedajax4764 3 роки тому

    Great teaching. thanks

  • @Kutakiarikashi
    @Kutakiarikashi 8 днів тому

    Thank you !

  • @percivalgebashe4376
    @percivalgebashe4376 Рік тому

    Nice

  • @amzie8412
    @amzie8412 Рік тому

    Thx bro you are our sun tzu 🙏

  • @ThomasTheThermonuclearBomb
    @ThomasTheThermonuclearBomb 2 роки тому

    Thanks for explaining so well!

  • @soumelee5661
    @soumelee5661 2 роки тому

    nice vid

  • @SkyV77
    @SkyV77 Місяць тому

    thanks big bro

  • @yevgenomelchenko732
    @yevgenomelchenko732 Рік тому

    Thanks Bro

  • @__joshplays.
    @__joshplays. 4 місяці тому

    thanks

  • @mihriomar5158
    @mihriomar5158 Рік тому

    Thank you 😇

  • @robertalexandermendezfamil8103
    @robertalexandermendezfamil8103 2 роки тому

    thanks a lot, Bro Code you are a hero!

  • @praveenbalajikalla-ng6mx
    @praveenbalajikalla-ng6mx 6 місяців тому

    niceee bro

  • @cherry6280
    @cherry6280 Рік тому

    thankyou bro👌👌

  • @Mey_xos
    @Mey_xos 2 роки тому

    Super

  • @andycadcam2265
    @andycadcam2265 2 роки тому

    Incredible !

  • @E_ter_nit_y
    @E_ter_nit_y 2 роки тому

    thank you

  • @mohamedelfadli3125
    @mohamedelfadli3125 Рік тому

    is there any difference between functions and methods in java, pls?

  • @abdialemu8391
    @abdialemu8391 Рік тому

    Love it

  • @tonytonychopper4525
    @tonytonychopper4525 Рік тому

    nice

  • @baharalgun6891
    @baharalgun6891 2 роки тому

    Thank you

  • @brobroo6154
    @brobroo6154 2 роки тому

    good

  • @samankucher5117
    @samankucher5117 2 роки тому

    thanks bro . i watched the add to the end i hope it helps:)

  • @ibrahimylmaz8378
    @ibrahimylmaz8378 2 роки тому

    thanks bro

  • @eugenezuev7349
    @eugenezuev7349 6 місяців тому

    thank you, Bro

  • @TheEvertonDias
    @TheEvertonDias Рік тому

    Thanks, bro!

  • @mrh6197
    @mrh6197 9 місяців тому

    👍

  • @danny.3036
    @danny.3036 3 роки тому

    Thanks, Bro! ☕ You're awesome!

  • @JuliHoffman
    @JuliHoffman 2 роки тому

    So helpful!

  • @huuloc8719
    @huuloc8719 2 роки тому

    Nice.

  • @enigmatimson4565
    @enigmatimson4565 3 роки тому

    very cool 😎

  • @yahiakhalil5658
    @yahiakhalil5658 3 роки тому

    Great ♥️

  • @developerjunior446
    @developerjunior446 3 роки тому +1

    Bro super

  • @dominiquedevries9972
    @dominiquedevries9972 3 роки тому

    Bro, your are my bro!

  • @megatron-ff3943
    @megatron-ff3943 3 місяці тому

  • @noah77
    @noah77 4 роки тому +1

    Ayyyy, nice!

  • @biswajeet9826
    @biswajeet9826 4 місяці тому

    Thanks Bruh!!❤😊

  • @rushikesh-vk3po
    @rushikesh-vk3po Рік тому

    6:42 return type