#24 Methods in Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • Check out our courses:
    Complete Java Developer Course Batch-3: go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    Enterprise Java Spring Microservices: go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : go.telusko.com...
    Coupon: TELUSKO20 (20% Discount)
    For More Queries WhatsApp or Call on : +919008963671
    Udemy Courses:
    Spring: go.telusko.com...
    Java:- go.telusko.com...
    Java Spring:- go.telusko.com...
    Java For Programmers:- go.telusko.com...
    Python : go.telusko.com...
    Git : go.telusko.com...
    Docker : go.telusko.com...
    website : courses.telusk...
    In this lecture we will learn:
    Method in Java
    Use of methods in Java
    Main method in Java
    return type in methods
    Syntax of method
    #1
    A method in Java or Java Method is a collection of statements that perform some specific task and return the result to the caller.
    Methods in Java allow us to reuse the code without retyping code.
    In Java, we create the components with the help of classes.
    Every class has a behavior and it is defined through the method.
    Behaviour or method is defined with the round brackets ().
    For every method, we also have to specify the type of access to it.
    Method does some tasks and it also returns something.
    We can call methods by creating an object.
    We can pass also pass values in a method.
    We can also put conditions inside the method like with the help of if..else.
    return keyword stops the execution of a method as it does not execute the further statements after it.
    #2
    -- void is used when we do not want a method to return something.
    -- String is used to return a string value.
    -- int is used to return an integer value.
    Main method is the start of execution from where the program begins.
    #3
    The syntax for method:-
    class Computer
    {
    public void playMusic()
    {
    System.out.println("Music Playing..");
    }
    }
    Github repo : github.com/nav...
    Java:- bit.ly/JavaUde...
    Spring:- bit.ly/SpringU...
    More Learning :
    Java :- bit.ly/3x6rr0N
    Python :- bit.ly/3GRc7JX
    Django :- bit.ly/3MmoJK6
    JavaScript :- bit.ly/3tiAlHo
    Node JS :- bit.ly/3GT4liq
    Rest Api :-bit.ly/3MjhZwt
    Servlet :- bit.ly/3Q7eA7k
    Spring Framework :- bit.ly/3xi7buh
    Design Patterns in Java :- bit.ly/3MocXiq
    Docker :- bit.ly/3xjWzLA
    Blockchain Tutorial :- bit.ly/3NSbOkc
    Corda Tutorial:- bit.ly/3thbUKa
    Hyperledger Fabric :- bit.ly/38RZCRB
    NoSQL Tutorial :- bit.ly/3aJpRuc
    Mysql Tutorial :- bit.ly/3thpr4L
    Data Structures using Java :- bit.ly/3MuJa7S
    Git Tutorial :- bit.ly/3NXyCPu
    Donation:
    PayPal Id : navinreddy20
    www.telusko.com

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

  • @christyaldridge3839
    @christyaldridge3839 5 หลายเดือนก่อน +8

    I have never really understood the concept of Class, Methods and Object until i watched this video... you really broke it down brother...Excellent instructions

  • @abhishekmitra9712
    @abhishekmitra9712 ปีที่แล้ว +40

    Watching this video today and realized that your joke about "Nothing phone" actually became true. There is actually something called nothing phone.😄

  • @burpeesquad
    @burpeesquad ปีที่แล้ว +15

    The "Nothing" joke hits hard. haha loved it
    😂

  • @Sorjen108
    @Sorjen108 ปีที่แล้ว +7

    Nothing phone 🤣
    Thanks for those great updated videos!
    Much love from Mauritius

  • @smittt20
    @smittt20 2 หลายเดือนก่อน

    The kind of details in the video like explaining every single word from void to object to function helped me a lot, i have never understood class and object effectively until now. Thanks a lot sir

  • @mango-strawberry
    @mango-strawberry ปีที่แล้ว +12

    Your explanation is extremely good

  • @sidharthansidhu4783
    @sidharthansidhu4783 ปีที่แล้ว +18

    It is weird how a Computer returns a pen😄. Excellent teaching 😍

    • @Lwa-fq5yz
      @Lwa-fq5yz 2 หลายเดือนก่อน

      🤣

  • @Tanned_guy
    @Tanned_guy ปีที่แล้ว +7

    Excellent teaching.

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

    Way of explain its really good.even don't know java also easy to understand...

  • @melwinsanthosh8135
    @melwinsanthosh8135 ปีที่แล้ว +4

    You are teaching very well than my teachers

  • @RishiKBose-25
    @RishiKBose-25 9 หลายเดือนก่อน

    Sir, it would be advisable to update your IDE promptly.

  • @AriRam-xs7ie
    @AriRam-xs7ie 10 หลายเดือนก่อน +1

    Can you please explain about the ' . ' (Dot)operater and it's function

    • @yashaswinihm4288
      @yashaswinihm4288 9 หลายเดือนก่อน

      It's basically used as a accessing operator.
      General used with object to access the data variables and methods

  • @NoName-im9rp
    @NoName-im9rp ปีที่แล้ว +4

    awesome sir keep it up

  • @wesjales5578
    @wesjales5578 7 หลายเดือนก่อน

    Why are youtube videos literally alway better then in person lectures?

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

    Great full ❤

  • @Gunasekhar-zj6eh
    @Gunasekhar-zj6eh 2 หลายเดือนก่อน

    what is the environment you are using?

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

    Thank you sir

  • @Marshal-y2y
    @Marshal-y2y 2 หลายเดือนก่อน

    Will you please explain why this playlist is not a continuous one ,like when i watch video number 23 and go to 24 ....you were actually saying that in previous video we have seen something like calculator program which doesn't exists in the previous whichever i watched

    • @md.ikramulislam9708
      @md.ikramulislam9708 หลายเดือนก่อน

      yeah the numbering is wrong sometimes ,that was in #22

  • @asuradevan1702
    @asuradevan1702 11 หลายเดือนก่อน

    Well Teached

  • @jb6652
    @jb6652 6 หลายเดือนก่อน

    how do you make the terminal on right side like that?

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

    great explanation 😍

  • @DarkyBoy-n1i
    @DarkyBoy-n1i 2 หลายเดือนก่อน

    But you teach well and I've never seen a teacher like you.

  • @JehanSaren
    @JehanSaren ปีที่แล้ว

    Hi Sir, please help🙏, how to access the variables inside the method to another method?
    Void Room1(){
    name1="Elisa";
    name2="Jefrey";
    }
    Void Room2(){
    i want to access "Elisa"
    }

    • @droste07
      @droste07 ปีที่แล้ว

      Then you have to create instance variable (variable inside the class) then you can access it anywhere in the class block!

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

    poetic

  • @iamgold743
    @iamgold743 4 หลายเดือนก่อน

    bro but compiler show : you shoud declare main method in computer class

  • @PoojaChindarkar-u9e
    @PoojaChindarkar-u9e 11 หลายเดือนก่อน +1

    its nice to get a nothing phone at 2 rupees!!

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

    dr's of java

  • @czarscrib3680
    @czarscrib3680 5 หลายเดือนก่อน

    I knew about the nothing phone but I wasn't expecting that joke😅😅😅😅

  • @ozodbekhamidov987
    @ozodbekhamidov987 ปีที่แล้ว

    good exam

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

    9:45
    Let's put Joke aside but you need to focus at learning Joke unlike this one 😅😅

  • @DarkyBoy-n1i
    @DarkyBoy-n1i 2 หลายเดือนก่อน +3

    Sir, Who returns nothing?🤣🤣🤣🤣

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

    What poor jokes, poor + funny jokes 😁 9:52

  • @hareeshbhat2571
    @hareeshbhat2571 8 หลายเดือนก่อน

    i didnt get laugh because of nothing but at last sir said ignore my poor jokes🤣🤣🤣

  • @rkrk5378
    @rkrk5378 11 หลายเดือนก่อน +1

    One SUGESSTION Sir, Please don't give different 2 examples, Please stick to one example through out the video.. if you are giving example of 'Computer' then please stick to that example only
    Instead of giving several examples like Car, Pen, Computer etc this could confuse a viewer.. OTHERWISE THE VIDEO WAS GOOD

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

    method inside method give error. please correct this anyone ij() in k() method show error
    class A{
    int i;
    int j;

    void ij(){
    System.out.println("i and j"+i+ " "+j);

    }
    int show(){
    return i+j;
    }

    class B extends A{
    int k;
    void k(){
    System.out.println("value of k"+k);
    ij(); }

    int sumijk(){
    return show()+k;

    }
    public static void main(String[] args)
    {
    B obj =new B();
    obj.i=44;
    obj.j=33;
    obj.k=21;
    int c=obj.sumijk();
    System.out.println("value of sum"+c);
    }
    }


    }

    • @vanajakshibc4587
      @vanajakshibc4587 6 หลายเดือนก่อน

      U have pass values to the methods which does calculation and returns values

  • @rawcore
    @rawcore 3 หลายเดือนก่อน

    09:50 Sponsored by Nothing huh 😂 .

  • @ahmedmoussa7519
    @ahmedmoussa7519 8 หลายเดือนก่อน

    Nothing Phone

  • @bantaigamer7123
    @bantaigamer7123 6 หลายเดือนก่อน

    sir pls hindi me bataiye

  • @GurijalaSudhakarrao
    @GurijalaSudhakarrao 2 หลายเดือนก่อน

    Super anna