#42 This keyword in Java

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ • 70

  • @karthi7490
    @karthi7490 9 місяців тому +71

    bro used entire 9 minutes just to define a single keyword , this shows he wants us to learn deeply 🙇🔥

    • @sai_teja_ig
      @sai_teja_ig 5 місяців тому +1

      while learning java i had realised that java is easier than java script bcoz in java script to explain the this keyword it will take easily an hour.

    • @adyan4010
      @adyan4010 2 місяці тому

      @@sai_teja_ig java and javascript are completely different so why compare?

  • @karthikplays69
    @karthikplays69 10 місяців тому +14

    00:02 Understanding the 'this' keyword in Java
    01:14 In Java, the stack memory and heap memory are used for different purposes.
    02:27 Local and instance variables with the same name in Java
    03:43 Assigning a variable to itself in Java can lead to unexpected behavior.
    04:55 In Java, 'this' refers to the current object instance.
    06:04 Creating a new object may cause issues with assigning values.
    07:19 Passing object references and differentiating between instance and local variables in Java
    08:36 The 'this' keyword represents the current object in Java

  • @Viralvlogvideos
    @Viralvlogvideos Рік тому +15

    I was learning java for project requirement and this video saved my life to understand this in java it is weird but understood :) No one can escape this three languages in their life java, python and js

  • @danl8994
    @danl8994 5 місяців тому +4

    Excellent way of teaching.
    Pushes us to wrong path only to make us understand the right path. Thank you.

  • @sandybeast07_sb
    @sandybeast07_sb 6 місяців тому +2

    Iam here from JS and i know the function of this keyword but when i was a beginner it was a huge headache for me. But after this video I can clearly state that Navin reddy sir aka telusko is one of the best teacher ever. Genius, the way he explained about this keyword..

  • @immadisettivarun
    @immadisettivarun Рік тому +8

    Amazing Explanation sir. Trying out different possibilities and explaining really nice

  • @vishalrohera4328
    @vishalrohera4328 8 місяців тому +1

    I watched many videos to understand how this keyword works, but none of them helped me. This video cleared all my doubts and questions. Thank you, sir, for this lecture!

  • @sahinsevinc41
    @sahinsevinc41 Рік тому +2

    The best Java teacher I have ever seen. Explanations, Examples are perfect

  • @Yashila_Jonnada
    @Yashila_Jonnada Рік тому +6

    Best explanation ever!
    I can't thank you enough for these amazing tutorials sir.

  • @HishamMohammed-gh7eh
    @HishamMohammed-gh7eh Рік тому +4

    Like me a person love details and how things works. I watched alot of tutorials about java and difficult topics like consturtor and this keyword,implicitly I understand it but I can't move without understanding initial way for things work. Your explaining with more fantastic details and different way, you are amazing . Thank you alot my teacher

  • @Headcator
    @Headcator Рік тому +2

    Your way of explaining things is fantastic. Thank you.

  • @VarunGowda-ho2rm
    @VarunGowda-ho2rm 8 місяців тому +1

    This video shows your passion towards teaching, great work sir, I'm impressed 👏🏼

  • @sathya8242
    @sathya8242 Рік тому +1

    Thanks a ton sir, now the confusion got cleared for me for THIS keyword…. Your explanation is irreplaceable…🥰🥰🥰🥰🥰

  • @1stGames
    @1stGames 5 місяців тому +1

    superb, i will never ever forget this keyword again, Thank you

  • @darswayeeyou
    @darswayeeyou Рік тому +3

    THIS is the only time I have ever understood the THIS keyword. Thank you so much!! So does that mean that the This keyword is only used in NON-STATIC methods?

  • @CHALLENGESTORY
    @CHALLENGESTORY Рік тому +2

    bro why do you look so humble ❤️ thanks for the videos anna..!!

  • @heytanibhi
    @heytanibhi Рік тому +1

    Thankyou sir ❤ keep teaching us like this. More respect to you sir.

  • @Luffy_2804
    @Luffy_2804 Рік тому +2

    best explanation
    quality content fr🙂

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

    public void setAge(int age, Human obj)
    {
    obj.age = age;
    }
    also works instead of creation a new object

  • @vicks3258
    @vicks3258 7 місяців тому +1

    Wow great concept Thanks you so much❤

  • @technocratsworld214
    @technocratsworld214 10 місяців тому +1

    brilliant explanation

  • @faheelansari7353
    @faheelansari7353 6 місяців тому +1

    Can we say that constructor return this that is why we can use to access instance variable
    Like
    Human obj = new Human();
    //Human(); It is constructor call

  • @souvikkundu
    @souvikkundu Рік тому +1

    Perfectly explained. Thank you.

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

    Hey Navin sir! Your fan from Nepal!

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

    Great way of explanation

  • @Kaviarasu_S
    @Kaviarasu_S 11 місяців тому +1

    I really helped me in understanding this, thanks ❤

  • @TreatsNTravelsByJaaiPawar
    @TreatsNTravelsByJaaiPawar Рік тому +1

    Grateful for this Playlist ...thank you!

  • @raghukumar8184
    @raghukumar8184 Рік тому +1

    hi Navin , pls make a video on passing this keyword into methd arguements and passing this keyword as arguments in parameterised constructors

  • @atulsolanki2519
    @atulsolanki2519 Рік тому +1

    Excellent explanation ,thanks😊

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

    This is very good explanation 👍

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

    Thank You. Nice explanation diagrammatically.

  • @SumanMondal-gv8bi
    @SumanMondal-gv8bi 10 місяців тому +1

    Thanks for the explaination Sir.

  • @ManishTamrakar-w7j
    @ManishTamrakar-w7j 6 місяців тому +2

    I literally clapped when this was used at last

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

    Happy teacher's day sir🎉🎉🎉

  • @MaxChan-zw8cx
    @MaxChan-zw8cx 5 місяців тому

    you are excellent at java concepts

  • @Le.Vi.No7
    @Le.Vi.No7 3 місяці тому +1

    finally understood the true meaning of "this"

  • @techcuriouscoder
    @techcuriouscoder 9 годин тому

    Salute you sir 🔥💯

  • @KARLAPATIARJUN
    @KARLAPATIARJUN 9 днів тому

    Why should we use this keyword in first statement of the method always? what happens if we not?

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

    Thanks Naveen 🔥 Big fan 💥

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

    Java means Telusko ❤

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

    Instead of setage or setname why can't we set it with a constructor and then use a method to return the value ?

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

    Amazing.

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

    one doubt, if we are not using this key word and just using two different variable names..will it work?

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

    beautifully explained by going wrong ways.. no one can ever forget this

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

      Learning by mistakes is the best way 😉

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

    What do you mean by the current object !?

    • @karots77
      @karots77 Рік тому +1

      I think you are asking it for this keyword am I correct? if that is your question, Then whenever you create an object it cannot use the variable directly so we need to use methods to access it, when you create an object to modify those values using methods those object are the current object for the "this" keyword (this is not a correct answer this is what i understand so far)

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

      No, I sometimes didn't get what he meant, :D I understood about this keyword, I know It refer to the current class object, we use in many ways, for builder pattern and for constructor to set the values so we define it and distigawise between local and global var, I don't care much much he don't explain the internal thing, so for refresh it is fine but not for the real knowledge. @@karots77

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

    Can anyone one help me to understand ?
    I didn't understand at this "when we call age function we are passing the value ?👀 But why the heck we did we get zero, what's happening if we mention local and instance variable as same name ?

  • @ShubhamVerma-nu3ze
    @ShubhamVerma-nu3ze Рік тому

    great teacher love you

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

    Super sir

  • @syedadil7256
    @syedadil7256 Рік тому +1

    Lil bit confusion sir.

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

    line 30
    obj.setAge(age: 30); // how did he type this inside the bracket--> age:

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

      Inlay hints added by vs code (not a part of the code)
      Not written by me.

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

      @@Telusko oh, I'm learning java using Eclipse which is why I was unaware..thanks bro..

  • @MahidharYouTube
    @MahidharYouTube 7 місяців тому

    varayyo vammo...entha baga cheppav babai.

  • @0shaad
    @0shaad Рік тому

    we cant call local variable outside of its local context

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

    That's a lot of THIS😂

  • @sadhanarealty
    @sadhanarealty 11 місяців тому +6

    Take simple example

  • @sarthak-salunke
    @sarthak-salunke Рік тому

    🙏❣

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

    why to use same name for variables use different and all problems solved

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

    thank god kadavul one ha padachan da 4 lakhs wasted on college

  • @someshwarreddy8463
    @someshwarreddy8463 7 місяців тому

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

    sir khud he kyu padh rahe ho