Getters & Setters | Java | Tutorial 31

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

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

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

    Hey Mike, you are the only one who explained so early in the video on "why" actually we should be using getters and setters and that is very important as when we can identify the problem and solution for it then the learning becomes easy. thank you.

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

    If Mike was my professor in College , then today i would be far ahead in programming 😍😃✌️

  • @JR-ne5vn
    @JR-ne5vn 4 ปีที่แล้ว +16

    Seriously man... i wish I would’ve found you earlier. Now I’m kinda failing my class, but this helped me a lot 🍀

  • @juanpablocruzrodriguez7346
    @juanpablocruzrodriguez7346 5 ปีที่แล้ว +17

    omg bro, you just saved my object-oriented university course! THANK YOU SO MUCH!!!

  • @jennheath108
    @jennheath108 2 ปีที่แล้ว

    I've been so stuck in my JAVA class and have watched multiple videos trying to figure this out. After watching your videos it finally clicks. You explain things so simply, thank you so much!!!

  • @angelicaspencer687
    @angelicaspencer687 5 ปีที่แล้ว +24

    Your videos are amazing I finally understand classes. Thank you

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

    Thank you so much! I have been having a hard time understanding setters and getters the way my professor explained it. But you sitting down and walking us through it like this was so helpful. I totally understand how to them now. You rock!

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

    finally found the answers i was looking for. in class i learned to make setters and getters and constructor but nobody explained the reasoning behind it. so thanks a lot man!

  • @Boameooo1000
    @Boameooo1000 4 ปีที่แล้ว

    Thank you very much. You are the only one who has explained Getters and Setters in full for me to understand. Cheers

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

    it took 5 hours for my prof. to explain this but my guy explained it in 17 minutes, thanks for this .

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

    You are the best on freecodecamp bro.

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

    This series is very fun to watch and learn about the new stuff every episode. Thank you soo much for making it.

  • @PsyntfcProductions
    @PsyntfcProductions 4 ปีที่แล้ว

    This needs more views. Not only is it explained well, but the example you used for movies is really effective.
    Congrats!

  • @ghita2003able
    @ghita2003able 2 ปีที่แล้ว

    THE BEST EXPLANATIONS PERIOD.

  • @AdrianTregoning
    @AdrianTregoning 2 ปีที่แล้ว

    Why did it take me this long to find your videos? Some of the best explanations I've seen on TH-cam. Thank you!

  • @cbt121314
    @cbt121314 4 ปีที่แล้ว

    This guy doesn't waste any time! One of the very very few I play at 1x speed.

  • @mikeynavarro3195
    @mikeynavarro3195 2 ปีที่แล้ว

    You explain better than my coding bootcamp's learning platform and i love you for that

  • @adipurnomo5683
    @adipurnomo5683 2 ปีที่แล้ว

    I have been confuse before about Getter setter implementation in real case. I got it. Great job bro

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

    this video is perfect. You explained everything so clearly. Thanks Mike.

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

    MAN, I am very thankful for the effort you're putting !

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

    Thanks Mr. Mike you made me understand the whole concept.

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

    I am not able to understand constructors. But you explained getters and setters very well. If you could explain constructors separately that would be awesome.

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

      We're using constructors to create different objects with different attributes. Think about a condition, where we don't use constructors. We can create only one object and with specific attributes. Only 'Movie1' can be there. if we want to add another object like Movie2 with different attributes than Movie1, then we have to declare Constructors. KEY WORDS: "different objects with different attributes".

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

    awesome i search about something help me in my JS and to be honest this amazing because you talk about the concept not the language , thanks a lot

  • @spag5296
    @spag5296 6 ปีที่แล้ว +13

    Wow, you are amazing at teaching! Thank you so much!

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

    @7:10 wow, so simple. I would've gone with a boolean value in a while statement, but this makes it so much simpler!

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

    Great videos! This was a perfect chance to introduce the switch statement... but yer, love your teaching style!

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

    Wow... you really clarified this for me. VERY GREATFUL!

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

    7:50 for people who wonder how to eliminate this unsightly long line of repetitive code, you can use a switch without brakes between all the "true" cases and a break after the last one. The default case is your else block.

  • @derrik-bosse
    @derrik-bosse 4 ปีที่แล้ว

    Best getter setter video so far

  • @jonm840
    @jonm840 3 ปีที่แล้ว

    Man your videos really helped me in my CSC course. Thank you so much

  • @MsSira12
    @MsSira12 4 ปีที่แล้ว

    This is by far the best video that explains the concept of setters & getters, you answered all my questions, PERFECT VIDEO. Thank you very much.

  • @abhishekhm1264
    @abhishekhm1264 2 ปีที่แล้ว

    Sir I am a big fan of you. Just hats off...

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

    Ur amazing at teaching man, keep up the good work!!!

  • @Bananainacar
    @Bananainacar 3 ปีที่แล้ว

    Such a solid video, thank you for explaining this so well and giving such clear examples.

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

    Awesome bro. I fully understand this topic from your video..... Thanks

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

    The best explanation ever!

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

    You are an amazing teacher!

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

    Really great at explaining the nuances of the concept. Keep up the good work. :)

  • @rian1196
    @rian1196 4 ปีที่แล้ว

    This is very helpful. He explained so well.

  • @salimz.8587
    @salimz.8587 3 ปีที่แล้ว

    You deserve millions of subscribers

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

    that is way better than any fucking tutorial, or tutor in my uni thanks mate I really appreciate it.

  • @juanestebanparraparra6302
    @juanestebanparraparra6302 2 ปีที่แล้ว

    Clearly explained. Thanks for the video

  • @williamhunt8313
    @williamhunt8313 5 ปีที่แล้ว

    Really well done Mike. Thanks

  • @night_traffic
    @night_traffic 2 ปีที่แล้ว

    You saved my life. Thanks a looot.

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

    This is literally perfect

  • @eljanpablo4712
    @eljanpablo4712 7 ปีที่แล้ว

    Good tutorial, this trick is encapsulation and helpful to security us program

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

    You're a G. Thank you bro.

  • @simranjitsingh3474
    @simranjitsingh3474 3 ปีที่แล้ว

    Good explanation. I like it.

  • @seanbrendangarrette7644
    @seanbrendangarrette7644 3 ปีที่แล้ว

    Good job, should have told us that the name of the rating should be Rating, capital R

  • @marksummers463
    @marksummers463 2 ปีที่แล้ว

    Suggestion: Show the exact paths values travel so we know exactly whats going on.

  • @SandeepSingh-wt9ih
    @SandeepSingh-wt9ih 5 ปีที่แล้ว +1

    Wow autograph plz u r the real superstar 😍😍😍

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

    hello Mike, thank you for this tutorial. i just wanna ask, can I use getters without setters? and the other way around?

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

    Hi Mike. Question: What was the purpose of creating setters for the title and director attributes if there are no restrictions to set?

    • @mohamedhussein6954
      @mohamedhussein6954 4 ปีที่แล้ว

      From my understanding, it's always good practice to use setters and getters regardless of whether there are restrictions or not.

    • @srschool4298
      @srschool4298 2 ปีที่แล้ว

      Its just an example SON!

  • @Dev_Eli
    @Dev_Eli 4 ปีที่แล้ว

    can you give an example of this with the user just inputting the title and printing out all of the info like the director, rating, cast, and whatnot?

  • @hind9719
    @hind9719 4 ปีที่แล้ว

    very well explained thank you so much

  • @mourningdovetunes
    @mourningdovetunes 3 ปีที่แล้ว

    So well explained thank you!

  • @Ianassa91
    @Ianassa91 3 ปีที่แล้ว

    Thank you! Superb tutorial!

  • @jishnuvedhikz4404
    @jishnuvedhikz4404 4 ปีที่แล้ว

    good tutorial.. very help full.. keep going

  • @simm5622
    @simm5622 3 ปีที่แล้ว

    Nicely explained 👍

  • @markevans5648
    @markevans5648 4 ปีที่แล้ว

    Great video thanks Mike

  • @issamelhoss3067
    @issamelhoss3067 3 ปีที่แล้ว

    you came in soo clutch
    thanks.

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

    Is there any difference between using "return title;" and "return this.title;" when using getters?
    Thank you!

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

    Awesome vid. Thanks!!!

  • @WasiAbdullah-h8n
    @WasiAbdullah-h8n 2 หลายเดือนก่อน

    Do a video on tracing in java

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

    Thank you so much, this is a great video!

  • @salimz.8587
    @salimz.8587 3 ปีที่แล้ว

    You are the best!

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

    Question: I see that we could use setTitle(title), without using this keyword, and it works the same. Does this keyword have any purpose here in constructor. Reference video time slot: 17:04

  • @Lucuskane
    @Lucuskane 3 ปีที่แล้ว

    Thanks for the videos! Love 💜

  • @FamiliarGecko
    @FamiliarGecko 5 ปีที่แล้ว +53

    I'm sorry, sir. This is a "dog" rated movie, your 8 year old son cannot watch it. But you can bring in your dog, for a family discount.

  • @pranaligaikwad4781
    @pranaligaikwad4781 5 ปีที่แล้ว

    I want data structures full course from you sir!!!!

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

    Instead of using set methods in the constructor, can't you just assign like random default values to them? like 000, xxx or even negative values

  • @pranav288
    @pranav288 3 ปีที่แล้ว

    Couldn't we use just an if statement to check if the ratings are not equal to one of those it can print "NR" or something

  • @pranaychoubey829
    @pranaychoubey829 4 ปีที่แล้ว

    if i created a array of strings and array of integers in a different class as private and provide the getter and setter for it. In the main class how do i set the string and integer according to the counter variable in for loop???

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

    Public Void setTitle(String title){
    this.title=title;
    }
    Public void setDirector(String director) {
    this.director=director;
    }
    Public String getTitle ( ){
    return this.title ;

  • @ramkumarsenthilnathan8662
    @ramkumarsenthilnathan8662 4 ปีที่แล้ว

    What if I want the user to input multiple movie names ,in this videos u have showed 3 what if he wants to input 10 names or 20 ..so we use a string array how exactly we should be doing it ?

  • @yowzer00
    @yowzer00 3 ปีที่แล้ว

    "And this is pretty cool, everything is going well."

  • @senthilmuruganr234
    @senthilmuruganr234 3 ปีที่แล้ว

    Excellent

  • @redcrafterlppa303
    @redcrafterlppa303 3 ปีที่แล้ว

    The movie class would be a prime example to use records now in java 17🤔

  • @nikhithanikki8413
    @nikhithanikki8413 4 ปีที่แล้ว

    I have created a pojo class with setters and getters. In class A I have set the values and in class B I wanted to get the values . Kindly help me how to create object and get the values

  • @wendie122
    @wendie122 3 ปีที่แล้ว

    Thank you so much for this.

  • @7barsofchocolate
    @7barsofchocolate 3 ปีที่แล้ว

    can someone pls explain why do we (at 15:20) just return rating in the getRating function, but for the other attributes we return this.title & not just title??

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

    good job,thank you!

  • @sandiegodronephotography9454
    @sandiegodronephotography9454 3 ปีที่แล้ว

    When you change the constructor to "this.setMake(make);"
    My program throws an overridable method call in constructor.
    It wants to make my setter setMake into Private. (making it unusable in main).
    Should we leave our constructors as this.make = make; ?

  • @nicoaristote9681
    @nicoaristote9681 4 ปีที่แล้ว

    thanks , this was really helpfhul

  • @Danilo-op1yp
    @Danilo-op1yp ปีที่แล้ว

    Yo how did you make your eclipse look like that ?

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

    Good one

  • @ELgeneral-pl9yg
    @ELgeneral-pl9yg 4 ปีที่แล้ว

    Damn bruh you explain this shit really well

  • @TheStewie96
    @TheStewie96 4 ปีที่แล้ว

    Thank you!

  • @myworldisenogh
    @myworldisenogh 4 ปีที่แล้ว

    Great, Thank you

  • @joeblue9129
    @joeblue9129 3 ปีที่แล้ว

    thank you all love

  • @gamesmaname5467
    @gamesmaname5467 4 ปีที่แล้ว

    your great at teacher man

  • @prashannasharma2540
    @prashannasharma2540 4 ปีที่แล้ว

    please show the full program so that people can take screenshots

  • @francistettey9114
    @francistettey9114 2 ปีที่แล้ว

    Please why the setters uses void method.

  • @ihssancanmturk3842
    @ihssancanmturk3842 4 ปีที่แล้ว

    Me think: wonderful this ;)

  • @ahmaddawood9691
    @ahmaddawood9691 5 ปีที่แล้ว

    EXCELLENT

  • @carolynw.2381
    @carolynw.2381 5 ปีที่แล้ว

    really helpful!!!

  • @brascoarts2634
    @brascoarts2634 5 ปีที่แล้ว

    Thanks alot

  • @husseinnajafli2305
    @husseinnajafli2305 4 ปีที่แล้ว

    What is the name of this theme?

  • @jn01996
    @jn01996 5 ปีที่แล้ว

    So what is the difference between setters and getters?

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

      setter is setting the value, getter is getting the value

  • @MoutazGamer
    @MoutazGamer 5 ปีที่แล้ว

    thank you man ♥