Java Tutorial for Beginners – 22 – using "this" keyword with constructors

///Java Tutorial for Beginners – 22 – using "this" keyword with constructors

Java Tutorial for Beginners – 22 – using "this" keyword with constructors

FavoriteLoadingAdd to favorites

using β€œthis” keyword with constructors

source

Java468x60
By |2019-09-01T22:13:06+00:00September 1st, 2019|Java Video Tutorials|12 Comments

12 Comments

  1. Zed Shockblade September 1, 2019 at 10:13 pm - Reply

    I hope you can do android development in your next tutorial.

  2. taras oleynik September 1, 2019 at 10:13 pm - Reply

    I can't find your java lessons in the playlists

  3. Smart Programming September 1, 2019 at 10:13 pm - Reply

    nice tutorial sir, keep it up πŸ‘πŸ‘πŸ‘πŸ‘

  4. Tary Khai September 1, 2019 at 10:13 pm - Reply

    Thanks,a very clear explanation…

  5. Phil Giblin September 1, 2019 at 10:13 pm - Reply

    It sounds like we're being thought Java by Owen Wilson lol. Great videos though πŸ˜€

  6. Samuel Osaroekiye September 1, 2019 at 10:13 pm - Reply

    Hi, luv ur tutorials, and its becoming clearer to me. I have been able to narrow down my confusion but I still don't get one thing. Why would the "placeholder name" and the "variable name" need to be the same, for the "this" keyword to be needed? Thanks

  7. bmdavison September 1, 2019 at 10:13 pm - Reply

    For anyone that's confused this might help.

    Here's an example without using this

    public class Point {
    public int x = 0;
    public int y = 0;

    //constructor
    public Point(int a, int b) {
    x = a;
    y = b;
    }
    }

    but it could have been written like this:

    public class Point {
    public int x = 0;
    public int y = 0;

    //constructor
    public Point(int x, int y) {
    this.x = x;
    this.y = y;
    }
    }

    This was taken from https://docs.oracle.com/javase/tutorial/java/javaOO/thiskey.html if anyone wants to take another look at it.

  8. hotice1027 September 1, 2019 at 10:13 pm - Reply

    Thank you very much for your work. You explain things much better and more understandable than my college professor. Very helpful.Β 

  9. __ September 1, 2019 at 10:13 pm - Reply

    Wish you SUCCESS in all what you choose to do

  10. Brianna in Singapore September 1, 2019 at 10:13 pm - Reply

    what does the "this." in front of "this.one" mean? I'm a little confused on what it's doing and its purpose. Love your videos!

  11. mickocross September 1, 2019 at 10:13 pm - Reply

    I got confused by all the usage of the word "This". Maybe shouldn't have named the file This and used This as your constructor. Still kinda confused. Love all your videos though, thanks so much.

  12. rbflowin September 1, 2019 at 10:13 pm - Reply

    Hi EJ,….wassup. I am about to finish your beginner tutorials.Are you uploading intermediate Java anytime soon?

Leave A Comment

*