+ 3

classes and polymorphism and memory in c++ and java

after test this code: https://code.sololearn.com/cFSDf4WyaTbi/?ref=app i realized that methods don't occupy memory in class (Probably they store separately) ; after thinking to polymorphism https://code.sololearn.com/cuaJ69BWNbEQ/?ref=app my guess was amplified. in Java we have this issue too 1_how system initilize memory for classes? 2_ how does system in memory when we use polymorphism in c++ and java? if you don't know answer just upvote question. my another question about this issue : https://www.sololearn.com/Discuss/2774853/?ref=app

4th May 2021, 5:50 PM
Mehran
Mehran - avatar
1 ответ
+ 2
Well, that's kind of hard question about function memory, I was curious about that too, and the best explaination I found was here: https://stackoverflow.com/questions/22119360/class-members-and-member-functions-memory-location
4th May 2021, 6:30 PM
Michal Doruch