Primitive Types and Reference Types in Java

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

КОМЕНТАРІ • 141

  • @egehurturk6209
    @egehurturk6209 4 роки тому +108

    This was the best explanation of Reference types I've ever watched. This was awesome. Thank you

  • @mr.shuklashukla3259
    @mr.shuklashukla3259 4 роки тому +21

    You are the greatest teacher ( who teach us free on UA-cam ) ,ever in the youtube , for teaching java . 😍

  • @hakancemgercek
    @hakancemgercek 2 роки тому +8

    Perfect explanation for an important topic. Even in some university lectures, the professors can't explain these things like you do. I already knew these things but the way you tell about them is just impressive. Thanks for your efforts. Great work.

  • @rahulkm3459
    @rahulkm3459 3 роки тому +7

    At the end of every video u say Thanks for watching 😊 but I have to say Thank you 😊 for making this tutorial...
    Really Helpful 🙏

  • @shivambhardwaj3273
    @shivambhardwaj3273 2 роки тому +3

    Crisp, clear, to the point!!
    Hats off Neso Academy for making learning so efficient!

  • @gamer-zy1uj
    @gamer-zy1uj 3 роки тому +5

    This is really best lecture on primitive and reference types.Nobody can explain like this.Thankyou sir for this amazing series🔥🔥🔥🔥🔥😊

  • @YeeWaiyau
    @YeeWaiyau 2 роки тому +3

    Have been struggling with the idea of reference variable and this amazing videos clear my doubts!!!

  • @maries.8809
    @maries.8809 Рік тому

    Thank you so much for this! I have always said that boxes makes my learning easier, and in this case it was definitely true. I have been struggling to understand how reference types work in Java and this video made me understand it.

  • @khaledadel2034
    @khaledadel2034 2 роки тому +7

    please note that non-primitive types do not store their values in stack they only store the reference in the stack and that reference will be connected to a random part inside "heap" , the heap will contain the value of that reference

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

      The reference address is stored in the stack(which contains the address/pointer) and its contents in the heap?

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

      @@farzin818 yes

  • @vaishnavir1018
    @vaishnavir1018 4 роки тому +1

    U r the world's best teacher sir😍😍

  • @jensjux4747
    @jensjux4747 4 роки тому +8

    gj man. Why cant university teachers explain it like this

  • @alphagamer2864
    @alphagamer2864 5 місяців тому

    The best explanation I have seen 👏 👌

  • @ashmitverma5612
    @ashmitverma5612 3 роки тому +1

    My teacher is refering this vid and presenting it, Thank You!

  • @akashmohite3075
    @akashmohite3075 3 роки тому +1

    Energetic explanation that helps to understand the concept

  • @p3t357
    @p3t357 4 роки тому

    You're amazing teacher. I watched few movies on UA-cam and I don't understood nothing. Thanks!!!.

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

    I watch so many videos and you are the best , I really understood the topic

  • @v.charanveerabathini808
    @v.charanveerabathini808 5 років тому +4

    Nice explanation

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

    What a clear explanation!! You saved my time!! I appreciate it

  • @mashapimatimba8063
    @mashapimatimba8063 4 роки тому +1

    You are a life saver man. Big ups!

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

    Thanks for the explanation... ✨

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

    thank u so much! i was struggling to understand the difference but u explained it really well

  • @jonathanelmoznino3995
    @jonathanelmoznino3995 4 роки тому +2

    Really great explanation and was very clear and on point. Thank You :)

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

    Thanks for making such conceptual videos.

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

    I love you Neso Academy. ❤️

  • @mohamedmahmoud-bw8vb
    @mohamedmahmoud-bw8vb 4 роки тому

    you are explaining with Abbreviated and awesome way 👍👏

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

    thankyo for clear explanation my teacher and i appreciate you millions times

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

    The best explanation ever....

  • @bipashajotwani7944
    @bipashajotwani7944 9 місяців тому

    This is an amazing explanation!

  • @Sulerhy
    @Sulerhy 10 місяців тому

    This was the best explanation. I like it.

  • @vamsireddy6981
    @vamsireddy6981 3 роки тому

    Best explanation,I am very clear about this now tq so much sir

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

    Great explanation!

  • @Omenemperor2
    @Omenemperor2 9 місяців тому

    Thanks for this informative videos!

  • @noumanrussel1112
    @noumanrussel1112 11 місяців тому

    Amazingly done! Hats off

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

    Bahut sahi sir ❤️🔥

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

    Great Explaination.
    Thank You.

  • @thrifterspoint1002
    @thrifterspoint1002 4 роки тому +2

    nice concept u share;

  • @mohamedthoufeeq375
    @mohamedthoufeeq375 3 роки тому

    The best explanation ever

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

    primitive should me named ---> expresion type. amd all would be clear and understable :) Thank you man ! this was very good explaination

  • @kingsmann_21
    @kingsmann_21 4 роки тому +1

    Thank u very very much ......I'm suffering from this confusion for 1 month.

  • @dikatsogaleboe3640
    @dikatsogaleboe3640 4 роки тому

    This made things so much clear. Thank You!

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

    Excellent class as usual

  • @rajatsoni-07
    @rajatsoni-07 Рік тому +1

    5:30 How "hello" is getting stored in the memory without declaring a variable or a container?

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

      when you instantiate a variable of type string, a string variable or container will be allocated in the memory that stores the reference of the value at the same time the value of the variable will be created in the heap memory.

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

    very simple and objective

  • @nouhatamba9976
    @nouhatamba9976 3 роки тому

    thank you soo much its so well explained good continuation

  • @babak4952
    @babak4952 3 роки тому +1

    Very good job

  • @moustafa_naguib
    @moustafa_naguib 3 роки тому

    A great explanation....

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

    Thank you so much you explained it so easily

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

    Very clear, thank you my friend)

  • @extems7895
    @extems7895 3 роки тому

    Excellent explanation!!

  • @mrglitch2982
    @mrglitch2982 4 роки тому +1

    the best explanation

    • @سيليناالمززززز
      @سيليناالمززززز 3 роки тому

      Hello friend, is it possible for us to study together because I am not good at Java and cannot study on my own. Can we cooperate together?

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

    yes yes thank! for your video help in me to understand my teacher lesion.

  • @darshanamadushan1142
    @darshanamadushan1142 3 роки тому

    Great explanation. keep it up!

  • @hamzael-badaoui1736
    @hamzael-badaoui1736 9 місяців тому

    great explination

  • @NewLondonMarshall
    @NewLondonMarshall 3 роки тому

    Fantastic video, thank you!

  • @aakashtiwari3677
    @aakashtiwari3677 4 роки тому

    Best explanation !!! Thank You

  • @soujanyavt
    @soujanyavt 4 роки тому

    Nicely expained. Thank you so much

  • @luqmannulhakiem4519
    @luqmannulhakiem4519 3 роки тому

    very good explaination!

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

    🙌wonderful

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

    Excellent

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

    amazing video!!!

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

    thank you thank you thank you THANK YOU !

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

    Great explanation. One question, why is important to know memory location etc..theory what is Refrence types vs Primitive types?

  • @aryanraje2770
    @aryanraje2770 3 роки тому +1

    The accent made it even more intresting.

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

    really good! thank you!!!

  • @haya_03
    @haya_03 9 місяців тому

    thank you so much !

  • @mohammedameer2365
    @mohammedameer2365 4 роки тому +1

    thanks man,finaly i catch it ❤

    • @سيليناالمززززز
      @سيليناالمززززز 3 роки тому

      Hello friend, is it possible for us to study together because I am not good at Java and cannot study on my own. Can we cooperate together?

    • @mohammedameer2365
      @mohammedameer2365 3 роки тому +1

      ونصيحه وانتي بتشوفي الدبلومه حلي problem solving في موقع hackerrank بالتوازي مع الدبلومه

    • @سيليناالمززززز
      @سيليناالمززززز 3 роки тому

      شكرا كثير

  • @RaviShankar-ow9pu
    @RaviShankar-ow9pu 5 років тому +1

    Sir, can't wait to witness the neso aap !!!how much more will I have to wait???

  • @steff420
    @steff420 4 роки тому

    Great video

  • @distractedbudha1859
    @distractedbudha1859 3 роки тому

    thank you so much

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

    thank u so much bro

  • @haribhaii04
    @haribhaii04 11 місяців тому

    Perfect!!

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

    thank you sir

  • @mockingspyhd6099
    @mockingspyhd6099 3 роки тому

    Thank you!

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

    Thanks

  • @Shivam-eh5fc
    @Shivam-eh5fc 4 роки тому +1

    public class Program
    {
    public static void main(String[] args) {
    String s1="hello";
    String s2=s1;
    s2="hi";
    System.out.println(s1);
    System.out.println(s2);
    }
    }. The output is : hello, hi sir why the output is different as they reference the same String “hello”

    • @raywinter8733
      @raywinter8733 4 роки тому +4

      Because you reassigned the value of s2. While they were both assigned to the same value, they could point to the same object in memory. But since s2 was reassigned to a different value, it had to point to a different object in memory.

  • @mordecai8707
    @mordecai8707 3 роки тому +1

    I just take the course outline from my class and look for corresponding videos on NESO Academy. My professor knows I don’t show up to class and wonders how I can still pass my exams and hw 😂

  • @smaylomoose6447
    @smaylomoose6447 4 роки тому +3

    Thank you very much for the explanation, I wanted to ask you for advice recently I wanted to learn how to create apps with flutter and the language it uses is dart and it's oo like java do you think I should learn java first then dart or it's best learn dart straight away?

    • @drewarocha42
      @drewarocha42 4 роки тому

      If you just want to build apps I’d use dart, most oop languages carry the same logic with different syntax

  • @s.r.shuvadev9159
    @s.r.shuvadev9159 5 років тому

    Awesome. But we are waiting for reamainder video in c programming and data structure series. Please sir make reamainder video as soon as possible.

  • @harshbhardwaj3542
    @harshbhardwaj3542 3 роки тому

    Thankyou

  • @s.....8353
    @s.....8353 4 роки тому +1

    super

  • @I_am_Alxui
    @I_am_Alxui 3 роки тому

    Thank u

  • @isurumadushan6774
    @isurumadushan6774 3 роки тому

    great!!!

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

    Thank You, Radha Radha

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

    Love it

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

    THANKS ALOTTTTTT

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

    the best...

  • @vigneshwaranravichandran8223
    @vigneshwaranravichandran8223 3 роки тому

    Sir why reference type directly not store a value instead of storing a address of the value?? Pls clear my doubt?

  • @simulink9564
    @simulink9564 3 роки тому

    Hmm 🤔 interesting

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

    habibi tum nice explain karti

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

    Sir How to get a variables memory address, can you give me code to it

  • @kiranreddy1747
    @kiranreddy1747 3 роки тому

    I want a playlist on advanced data structures

  • @bobertren3941
    @bobertren3941 3 роки тому

    legend

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

    like like 👍🏻👍🏼

  • @AbhiTrade-ip4xx
    @AbhiTrade-ip4xx 3 місяці тому

    Why s2 not containing the address of s1? Why not s2 = s1 address?

  • @manoharkumar-y7q
    @manoharkumar-y7q 7 місяців тому

    💥💥💥💫

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

    Why is that i1 and i2 have different values as you mentioned in the last part. of video. In my view, they do have different adresses which make i1 and i2 are different. But they do have same value, because i2 is assigned value 5 from i1.

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

      as they both stored in different addresses makes the values different.

  • @parthpandya2909
    @parthpandya2909 4 роки тому

    How to make reference variable of int?????

  • @ledajoro6965
    @ledajoro6965 4 роки тому

    Thank you sir for the explanation, it was very well done! I have a question but feel free to not answer it.
    In the reference type example you gave, you give us two variables "s1" and "s2". "s1" references the address location of the object string "hello" that is 1008 right? but in the case of "s2" it references the VALUE of "s1" not the address location of it, so that would make "s2" a primitive type because it references the value instead of the directory no?
    what if "s2" put in its value the address location of "s1" so that then that can take it to the "s1" value and since now the "s1" value is the string location "hello", the program finally take us to the string location "hello". is that possible?

    • @rubendariofrancodiaz6944
      @rubendariofrancodiaz6944 4 роки тому +1

      Both s1 and s2 references to the address location of the value which is 1008. None of them are referencing an actual value. About the second part, Java doesn't behave that way because if you have n Strings then it would take a lot of runtime complexity to get to the actual value, so referencing to the actual value address is just straightforward.

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

    thanks my Egyptian friend

  • @RadheyShyam-sd8xw
    @RadheyShyam-sd8xw 4 роки тому +1

    🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻👍👍👍👍👍👍👍👍