Java CLASS, OBJECT, HEAP Memory and Class Variable Types. Object Oriented Java Tutorial #9.1

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 58

  • @Jandroraya
    @Jandroraya 6 лет назад +9

    had a bunch of "oh damn ok that's easier than I thought" moments. Thanks man

  • @Invento_Boost
    @Invento_Boost 5 лет назад +10

    All day i was studying these concepts and finally got the perfect video on it. Thanks a lot!

  • @starriet
    @starriet 4 года назад +4

    newbies can be confused at 6:11, usually when you say 'instance variables', it indicates the variables in the instance, such as 'breed', 'age', 'color' in the example. To be precise, those non-static fields are 'instance variables', and static fields are 'class variables'.

  • @MD-py2de
    @MD-py2de 4 года назад +1

    The best straightforward and simple java course I have ever seen, Thank you.

  • @sangeetakumar3857
    @sangeetakumar3857 7 лет назад +3

    Finally, I found videos that explain the concept very well ! Thanks a lot !! I have seen so many Java tutorial videos but my understanding is so much better after watching your videos. The good visual explanation is what sets your videos apart from the others . It is sooo easy to get the concepts by looking at the visuals !!!

    • @jeerawanpk
      @jeerawanpk 4 года назад

      Wow, I felt exactly the same thing. I searched a lot of video just to get this kind of explanation.

  • @SmartProgramming
    @SmartProgramming 6 лет назад +2

    very helpful tutorial, keep it up sir 👍👍👍👍🙂🙂🙂🙂

  • @محمدمصعب-ج1ن
    @محمدمصعب-ج1ن 3 года назад

    great , the best and clearest video ever .

  • @asbkochiadmin9064
    @asbkochiadmin9064 5 лет назад

    You explains it so well....The concepts that I found hard to understand are explained so well in your tutorial that now I feel its so simple...Thanks a lot...

  • @pristine_the_tech_guy
    @pristine_the_tech_guy 5 лет назад +2

    Perfectly explained.. You're amazing sir.

  • @xxxx-kv9ei
    @xxxx-kv9ei 6 лет назад +1

    "instance" is a word used for dungeons in games, which are accessed through a portal and takes you to another locations. It means a method which is accessible somewhere else

  • @shiVam01242
    @shiVam01242 3 года назад

    Thankyou ... Beautifully explained

  • @thestarinthesky_
    @thestarinthesky_ 5 лет назад

    The best explanations ever! It was very helpful. Thank you.

  • @cablemaster8874
    @cablemaster8874 3 года назад

    Thanks for your teaching method

  • @mohammadfarhan6940
    @mohammadfarhan6940 5 лет назад

    Jai ho Aapki😃😃😃
    You have cleared all my doubts, thanks for the explanation

  • @nima7605
    @nima7605 2 года назад

    Your tutorials are awesome. Keep it up

  • @jeerawanpk
    @jeerawanpk 4 года назад

    Wow, thank you so much. Very clear explanation.

  • @75STARFISH
    @75STARFISH 3 года назад

    This is super helpful. Thank you so much!

  • @kmtk82
    @kmtk82 5 лет назад +3

    amazing, thank you!

  • @dprashanth5279
    @dprashanth5279 5 лет назад +1

    Underrated channel in RUclips
    Your video are awesome😍😍😍😍😍

  • @aksanoramos2898
    @aksanoramos2898 5 лет назад

    You are the best, well done.

  • @altinuku6766
    @altinuku6766 6 лет назад +1

    Hi,
    congrats to your video.
    I think that you can makeit better after minute 10:38 when you say that dog2 and dog3 has the same age.
    It is incorrect cause you before , correctly says that they are simply pointers to the object D2.
    It is much better to not speak about dog2 and dog3 has the same age, but this two different pointers cause they point to th same object , every modification of the variables of the object D2 will be visible for both pointers.
    I think that all this confusion comes when in java they teach to us :
    We create and object using Dog dog2 = new Dog(); without explainis clearly every piece of this point.
    1 ) it is an expression. ( expressions can have different forms )
    2 ) The evaluation of this expression start from right to left to be excetuted.
    3 ) new Dog() creates a new object in HEAP (our object D2 and our object has a memory address )
    4 ) Dog dog2 define a object reference.
    5 ) the simbol = assign the memory address of the object to our object reference.
    [ if we try to do a System.out.println(dog2) we will have the memory address stamped. ]
    6 ) if we wont to access to every variable of our object ( D2 ) we can do it simply calling the object reference and the name of the variable that we want to access.
    example dog2.age
    So , as last i want just to remember that dog2 and dog3 are not our object but just our OBJECT REFERENCE.
    Object is all the structure and Object Reference is simply the address memory of our object.

    • @amlam5685
      @amlam5685 6 лет назад

      hi Altin Uku

      what is the point of having these 2 object references dog2 and dog 3 ? am new on programmig

    • @altinuku6766
      @altinuku6766 6 лет назад

      ​@@amlam5685 watch this video: ruclips.net/video/UcPuWY0wn3w/видео.html
      When you program sometimes you are costraint to to have two or more object references to the same object in memory. You should always pay attention when you modify values cause if you modify a variable value of the object from one of the refecence object it will be visible for all the reference objects that point to this object.
      One case is when you need to have access ( just to read the data of the same object in different point of the program.

  • @akshayak.b8722
    @akshayak.b8722 4 года назад

    Amazing explanation

  • @sridevi-jp3ic
    @sridevi-jp3ic 4 года назад

    Nice video ! Thanks a lot !

  • @vijaygurusamy4055
    @vijaygurusamy4055 2 года назад

    Good explanation

  • @muditkushwaha6176
    @muditkushwaha6176 6 лет назад

    Very nice video bro..good job..my concept got cleared..

  • @gamersoul1098
    @gamersoul1098 4 года назад

    great explanation tnxxxxxx

  • @bijimoljoseph6313
    @bijimoljoseph6313 4 года назад

    Thank you

  • @chayae3740
    @chayae3740 3 года назад

    Thanks a lot

  • @srinikaganegoda6967
    @srinikaganegoda6967 3 года назад

    good lesson sir

  • @uttammewara7380
    @uttammewara7380 5 лет назад

    WAS REALLY GOOD VIDEO !!

  • @makikiplays4173
    @makikiplays4173 4 года назад

    NICEE, THANKYOU

  • @JAYESHSHEWALE
    @JAYESHSHEWALE 6 лет назад

    Very nicely explained...subscribed

  • @SeniorGeneralOmega
    @SeniorGeneralOmega 6 лет назад +1

    Happious code doesn't come aroudn as objects without space : but in time with 0 functions 0^0 in object in a line can resend information with emails then a computer gets jerked a system running a across a main waiting for a main signal 0 : 1 ) .

  • @信法
    @信法 4 года назад

    How is the memory (stack and heap) look like if I have array of object?
    Example: Person [] people = new Person[10];
    people[0] = new Person();
    people[1] = new Person();
    where Person class has 2 instance variables name and age?

  • @RaghuDevBattula
    @RaghuDevBattula 3 года назад

    bark() and run() will throw error as the "local variables" are not initialized.

  • @koshykoshy9276
    @koshykoshy9276 7 лет назад

    very good explanation.

  • @h3w45
    @h3w45 5 лет назад

    Thank you.

  • @ajithk2183
    @ajithk2183 4 года назад

    Thank uuuuu....so much

  • @ZiadddTV
    @ZiadddTV 6 лет назад

    perfect explanation!

  • @muditkushwaha6176
    @muditkushwaha6176 6 лет назад

    Keep going like this..

  • @mayankchauhan9867
    @mayankchauhan9867 7 лет назад

    sir I have prblm that i understood your concept very well but i DON't KNOW HOW TO PRACTICE .PLEASE HELP ME SIR ..

  • @thecreditcardrewards
    @thecreditcardrewards 7 лет назад

    Objects are stored in heap by default? Is their any way to store object in somewhere else?If object are stored,they will consume memory, so how to clean that memory?

    • @smartherd
      @smartherd  7 лет назад

      +Rushabh Oswal well you don't have to clean memory. Once the reference variable pointing to that object becomes null then the object becomes useless.. So here comes the garbage collector that automatically cleans up the objects and increase the heap memory back.

    • @thecreditcardrewards
      @thecreditcardrewards 7 лет назад

      Smartherd , how to store object into some other location?

    • @smartherd
      @smartherd  7 лет назад

      +Rushabh Oswal objects are always stored in heap memory. There is one more memory area known as stack memory where the primitive data type and reference variables are stored. I will make a separate video on heap memory, stack memory and garbage collector.

  • @satyamkumarmal7783
    @satyamkumarmal7783 4 года назад +1

    You are following head first java book I think so !!!

  • @mercy2655
    @mercy2655 4 года назад

    He is speaking in English and why i feel like he is teaching in hindi.

    • @smartherd
      @smartherd  4 года назад +1

      Because u r able to understand my English 🤣

    • @mercy2655
      @mercy2655 4 года назад

      @@smartherd Sir your explanations are directly getting into my head.Thank you Sir.

  • @hirakain5006
    @hirakain5006 6 лет назад

    What is requirement of Dummy Variable???
    Dog dog4;