Java This Keyword – Java Programming Tutorial

///Java This Keyword – Java Programming Tutorial

Java This Keyword – Java Programming Tutorial

FavoriteLoadingAdd to favorites

This video takes you through a programming example where you will have to use “this” keyword in java tutorial.
What is THIS Keyword in Java?
Keyword THIS is a reference variable in Java that refers to the current object.

Java468x60

Like, share and subscribe our channel for more videos.
Watch more videos on our YouTube channel at
READ this as a book on Amazon by viewing at
Visit our website for more! www.guru99.com
Read our blogs in
FACEBOOK! Would you prefer to watch more about us? Like our page for more
TWITTER! Tweet for us on Twitter with #guru99 and follow us on
LinkedIn! Follow us here

THANKS! We appreciate you reading this and hope you have a wonderful day!

Sincerely,
Guru99

source

By |2019-11-11T23:51:57+00:00November 11th, 2019|Java Video Tutorials|48 Comments

48 Comments

  1. Guru99 November 11, 2019 at 11:52 pm - Reply

    Check out our FREE Real Time JAVA Project: https://www.guru99.com/live-java-project.html

  2. Rawknee Salami November 11, 2019 at 11:52 pm - Reply

    a WHOLE 1 hour lecture didn't get this across. Wth college.

  3. Daniel Alfonso November 11, 2019 at 11:52 pm - Reply

    I love you

  4. Kyle X November 11, 2019 at 11:52 pm - Reply

    But shouldn't that already be inherent in making object?

    For example, if you make a class called Person with fields: name and age, each new instance is guaranteed to have their own variables for name and age.

    So if you do

    Person customer1 = new Person
    Person customer2 = new Person

    then

    customer1.setData("Kyle", 18);
    customer2.setData("Bob", 22);

    then each object has their own fields filled up.

    so if you do

    customer1.showData() it should show Kyle 18
    whereas if you did

    customer2.showData() it should show Bob 22

    That beginning, everything before the period, is the name of the object instance. Right? That indicates what data the showData method should be looking at. So if that's how objects work, I don't understand when and why we would use this.

  5. Debjyoti Chattopadhyay November 11, 2019 at 11:52 pm - Reply

    that was a great explanation man

  6. vac tum November 11, 2019 at 11:52 pm - Reply

    wow, very good, easy and helpful explanation, Thanks

  7. Harsh Rai November 11, 2019 at 11:52 pm - Reply

    why is there condition a=a , b=b in the method

  8. Panos Papadopoulos November 11, 2019 at 11:52 pm - Reply

    I have spent almost half an hour searching about this. keyword without understanding it at all. But after watching that video I am confident that I got it! Thank you sir!

  9. Vương Phạm Quân November 11, 2019 at 11:52 pm - Reply

    very easy to understand, thanks you very much.

  10. Azus November 11, 2019 at 11:52 pm - Reply

    honestly went through a lot of java not knowing what 'this' ment for a few months, thanks for explaining it to me

  11. Shripad Jalamkar November 11, 2019 at 11:52 pm - Reply

    thank you

  12. meow peow November 11, 2019 at 11:52 pm - Reply

    ten out of ten

  13. Smart Programming November 11, 2019 at 11:52 pm - Reply

    thank you sir, "this" tutorial is really awsm 😀😀👍👍👍

  14. NoOr AyAn November 11, 2019 at 11:52 pm - Reply

    thanks

  15. Renee Starlight November 11, 2019 at 11:52 pm - Reply

    Thnx ..really useful

  16. XuNkYbOy November 11, 2019 at 11:52 pm - Reply

    greattt!!!!!

  17. Xylan November 11, 2019 at 11:52 pm - Reply

    this.comment=thanks_a_lot_man;

  18. Goodrum Productions November 11, 2019 at 11:52 pm - Reply

    use tabs please

  19. Peshraw Aziz Hassan November 11, 2019 at 11:52 pm - Reply

    good

  20. JMaia Trader November 11, 2019 at 11:52 pm - Reply

    I wish all tutorials came like this without an Indian accent. Nothing against Indians from India or accents but whenever you combine these two the English sounds comes out a little too seasoned by the rolled up tongue and highly expressed ( R's) and that causes a tiny unpleasent disruption in the ear drums.

  21. Chari Yuvi November 11, 2019 at 11:52 pm - Reply

    Cool.. Nyc

  22. Clash with Ashish November 11, 2019 at 11:52 pm - Reply

    Nicely explained

  23. Mohit Bopardikar November 11, 2019 at 11:52 pm - Reply

    Thanks!!

  24. Uday Budhathoki November 11, 2019 at 11:52 pm - Reply

    Wow a real life saver. Thanks

  25. John Bateman November 11, 2019 at 11:52 pm - Reply

    I am more of a visual learner. The simple visuals in this helps so much. I also learn better if I know WHY we are doing something. In other words, try to answer the question "what problem are we trying to solve?" This video also explains that. Most educators teach by saying "watch me code" and I find that frustrating. This is a superior source – thank you!

  26. Neeraj Verma November 11, 2019 at 11:52 pm - Reply

    Superb explanation in shortest time!!

  27. علوم الحاسوب اون لاين November 11, 2019 at 11:52 pm - Reply

    you are the best neggga

  28. Crispy Bagpipes November 11, 2019 at 11:52 pm - Reply

    Thanks dude you're a lifesaver

  29. ahlem ahlem November 11, 2019 at 11:52 pm - Reply

    Thanks

  30. Mark Goldstein November 11, 2019 at 11:52 pm - Reply

    Well done. THIS is a great video.

  31. No Name November 11, 2019 at 11:52 pm - Reply

    use an IDE, damn

  32. Sankari Boy November 11, 2019 at 11:52 pm - Reply

    Thanks.. 😁😁

  33. M G November 11, 2019 at 11:52 pm - Reply

    ***Correction***: public static void main(String[] args) /
    args can be written as argument too (you can actually write it as anything eg.: abcd, placeholder, putWhateverWordYouWant, declare)

  34. Gaurav Kumar November 11, 2019 at 11:52 pm - Reply

    nyc i got it, really helpful.

  35. тσвι November 11, 2019 at 11:52 pm - Reply

    Thank you 🙂

  36. function myFunction November 11, 2019 at 11:52 pm - Reply

    wth. this tutorial only makes me fully understand the this keyword. thanks to you,

  37. Satoshi Nakamoto November 11, 2019 at 11:52 pm - Reply

    thanks

  38. Neeraj Bhasin November 11, 2019 at 11:52 pm - Reply

    why this should be the first call in constructor? anyone?

  39. shaunak hapse November 11, 2019 at 11:52 pm - Reply

    really you an awesome guy

  40. DarkLevis November 11, 2019 at 11:52 pm - Reply

    . operator looks weird for it as this should be a pointer but hay, it's java

  41. Tony Wong November 11, 2019 at 11:52 pm - Reply

    I love how condescending he is @3:25

  42. Avi Aryan November 11, 2019 at 11:52 pm - Reply

    You are so good thanks a lot.

  43. david villa November 11, 2019 at 11:52 pm - Reply

    why we just can not name differently from class variable name?

  44. Dave Compton November 11, 2019 at 11:52 pm - Reply

    Very useful, but please stop using 'append' when you mean 'prepend' 8¬]

  45. Anil Mawji November 11, 2019 at 11:52 pm - Reply

    Ahh, first impression is that you should probably be using tabs. Regardless, it is a great tutorial- thanks for making it!

  46. Gaurav Pandey November 11, 2019 at 11:52 pm - Reply

    Great simple video but… HOW WILL YOU PRINT THE OUTPUT?? There is no showData method.
    >>> Output is blank <<<

    class Account2{
    int a;
    int b;

    public void setData(int c ,int d){
    a = c;
    b = d;
    }

    public static void main(String args[]){
    Account2 obj1 = new Account2();
    Account2 obj2 = new Account2();
    obj1.setData(2,3);
    obj2.setData(4,5);
    }
    }

  47. Sharath P November 11, 2019 at 11:52 pm - Reply

    thank you! and also provide the user the option to view the video in full screen at your website

  48. ApkaGuruji ProgrammingLover November 11, 2019 at 11:52 pm - Reply

    good explanation.

Leave A Comment

*