check out the video again, she says "this variable will be in the stack memory and the object in the heap and variable a1 will be pointing to the heap memory", it is because classes are reference types.
@TheSoftwareFuture the Videos aren´t complete here. They have been chopped randomly I guess, still very useful and conceptual. Even if the title is Encapsulation, this covers the basics of constructors.
THERE ARE NO ENCAPSULATION HERE. ENCAPSULATION IS SIMPLY MAKING THE FIELDS/VARIABLES PRIVATE. AND WHEN U USE THE OBJECT IN ANOTHER CLASS, U WONT BE ABLE TO ACCESS THE VARIABLES. SO U SIMPLY USE THE PUBLIC METHOD GET AND SET TO ACCESS THEM OR PASS VALUES TO THEM
So when I instantiate an object a1, how does the memory look like?
From what she said: 'stack' should have 2 bytes with a1 written in, and then next n (how many?) bytes that contain the memory address pointing somewhere at 'heap' where the actual a1 object is located?
its very helpful and mam ur teaching is superb!thanx for this wonderful class.
rkiran621 1 week ago
Very good and clear explanation
sathishlm 1 month ago
Mam Your Energy for teaching is WOW... Great Teacher.
macbangalore100 2 months ago
the problem with java teachers is they use to many big words.. lol. Constructor shmuctor
2112mbell 5 months ago
It is really helpfull, amazing.
I like it, thanks a lot.
keep posting more videos.
Some times I get confused and I don´t know when to use constructors, structors or interfaces because its functionalities seems to be the same.
Can some one help me please???
bhunnymusic 6 months ago
@rupreetsoni
check out the video again, she says "this variable will be in the stack memory and the object in the heap and variable a1 will be pointing to the heap memory", it is because classes are reference types.
bhunnymusic 6 months ago
@TheSoftwareFuture the Videos aren´t complete here. They have been chopped randomly I guess, still very useful and conceptual. Even if the title is Encapsulation, this covers the basics of constructors.
i7rs 6 months ago
THERE ARE NO ENCAPSULATION HERE. ENCAPSULATION IS SIMPLY MAKING THE FIELDS/VARIABLES PRIVATE. AND WHEN U USE THE OBJECT IN ANOTHER CLASS, U WONT BE ABLE TO ACCESS THE VARIABLES. SO U SIMPLY USE THE PUBLIC METHOD GET AND SET TO ACCESS THEM OR PASS VALUES TO THEM
TheSoftwareFuture 7 months ago 2
So when I instantiate an object a1, how does the memory look like?
From what she said: 'stack' should have 2 bytes with a1 written in, and then next n (how many?) bytes that contain the memory address pointing somewhere at 'heap' where the actual a1 object is located?
cronnin 7 months ago
@rupreetsoni
I believe that's what she drew on the board..#idiot
SkitSophrenia 7 months ago