Java Classes, Objects, Stack and Heap Memory Explained - Part 1 of 2

preview_player
Показать описание
Hi There,

This video is explanation of basic but very important java concepts Class, Object and how the Objects are stored under the hood on Heap Memory
Рекомендации по теме
Комментарии
Автор

man, am I glad I found this channel. All other channels just show you the code and sometimes, what it does. But NOBODY tells you what happens in the background.

I'm taking my OCA in a couple of months and I believe I've just found the perfect resource to help me ace the test. Good work.

puletshehla
Автор

I was confused about memory management in java...now all clear. Thank you for an amazing presentation.

akashjshetty
Автор

This video was worth every second of my time .... learnt a lot form this dear sir.

obaldalmeida
Автор

Thank God i found this gem 🙏❤️ thanks sir.

brajeshmohanty
Автор

This class really helps to understand the concept.thank you very much ❤

LearnEasy
Автор

Hi sir, Your teaching style is very effective, and the visuals you provided have greatly aided our understanding of memory management. Could you please explain the following concepts with visuals?

After writing the Java code with .java extension

we will compile it using a Java compiler (like javac)

After compilation, the bytecode is loaded into the method area of the JVM . The method area stores class-level data like method bytecode, static variables, and type information. Here I would like to know how these data will be saved in Method area with your style of visuals ?

Static variables are allocated memory space in the method area. They exist for the entire duration of the program and are initialized with default values (if not explicitly initialized) when the class is loaded.


Static methods are also loaded into the method area. When a static method is invoked, its local variables are allocated memory on the stack. These variables exist only for the duration of the method invocation.


When the main method is called (which is static), it too is loaded into the method area. As the main method is executed, any local variables declared within it are allocated memory on the stack.

Please kindly explain the above concerns with visuals, how you explained for object creation

Thank you sir

usai-gmzy
Автор

Yours is one of the best videos I watch to get a clear understanding of Java. But Java has become the basic or back bone, so can you create more videos detailing Spring Cloud, micro services etc

shama
Автор

That was really awesome presentation, please keep going sir.

mohansurendar
Автор

I watched, I benefited, I absolutely adored, I subscribed... Thanks a bunch...

onlymusic
Автор

The explanation was too good, can u pls create a playlist. That'll be very much appreciated.

TheRr
Автор

very nice explanation, i understand clearly .

pranalipatil
Автор

It's not better it is the best ☺️ .... I have one doubt here when we create an object using a new keyword the next is person() right what is this actually I know this is a constructor but what it does exactly

Any information will be helpful to all please share your knowledge ☺️

mahendramungamuru
Автор

Sir please make vedio on how array stores in heap

jahnvichaurasia
Автор

Please Zoom the application for more clarity

deeptimonga
Автор

Student a = new Student();
When we create a object like this, the jvm loads all the object data(like properties, methods)in the form of byte code in a heap memory area.
In stack memory, frame is Creted for main method from that the code executes line by line what is containing in that
The jvm converting the byte code of instructions containing in main method into binary language .
But some of them says the entire object is loaded in physical memory (means all object data in binary form )please clarify sir which one is

thimothipalipaka
Автор

Sir please make vedio on, inheritance

jahnvichaurasia
Автор

@10:05, Um, why does the STACK keeps occupying its memory, when it's only a local variable pointing to the heap?
Added remarks: main() and p.sayYourName() are the only two added in the stack right, the rest are local and pointers. then at the end of the scope of main() the java GC will do its thing.

hortonzkog