#26 Stack And Heap in Java
Check out our courses: Mastering Agentic AI with Java : https://go.telusko.com/agentic-ai Coupon: TELUSKO10 (10% Discount) DevOps Bootcamp: https://go.telusko.com/complete-devops Coupon: TELUSKO10 (10% Discount) Master Java Spring Development : https://go.telusko.com/learn-master Coupon: TELUSKO10 (10% Discount) For More Queries WhatsApp or Call on : +919008963671 website : https://telusko.com/ Udemy Courses: Java Spring:- https://go.telusko.com/Udemyjavaspring Java:- https://go.telusko.com/udemyteluskojava Spring: https://go.telusko.com/udemyteluskosp... Java For Programmers:- https://go.telusko.com/javaProgrammers Python : https://go.telusko.com/udemyteluskopy... Git : https://go.telusko.com/udemyteluskogit Docker : https://go.telusko.com/udemyteluskodo... Instagram : / navinreddyofficial Linkedin : / navinreddy20 WhatsApp : https://go.telusko.com/whatsapp TELUSKO Android App : https://go.telusko.com/TELUSKOAPP TELUSKO IOS App : https://apple.co/3SsgmU2 Discord : / discord In this lecture we are discussing: 1) Memory management in java and typed of categories to store data in memory. 2)What is stack ? 3)What is heap ? 4) where instance variable and local variable is allocated? #1 In java we are managing our managing our memory using two data structure stack and heap. two categories to store data in memory: 1) Stack data structure 2) heap data structure #2 Stack is data structure which follow LIFO(Last in First Out) principle. #3 heap is data structure which is used to store data in form of object and object is a collection of data and method. #4 class Student{ int instVariable; //store in object and object created in heap public static void main(String []args){ int localVariable=0; //local variable store in stack frame of method in stack area. Student st=new Student(); //st is reference variable store address of new Student() object } public int add(int num1,int num2){ return num1+num2; } } -- instance variable stored in object and object are in heap therefore we can say that instance variable created in heap. -- method declaration and definition is present in object but actual implementation present in stack frame of stack. -- local variable created in stack during call of method. -- stack frame of called method is present in stack area. -- st is reference variable created inside the current stack frame and it is reference variable store address of student object created in heap area. -- new Student() create object in heap area and pointed by his reference variable. Github repo : https://github.com/navinreddy20/Javac... More Learning : Java :- https://bit.ly/3x6rr0N Python :- https://bit.ly/3GRc7JX Django :- https://bit.ly/3MmoJK6 JavaScript :- https://bit.ly/3tiAlHo Node JS :- https://bit.ly/3GT4liq Rest Api :-https://bit.ly/3MjhZwt Servlet :- https://bit.ly/3Q7eA7k Spring Framework :- https://bit.ly/3xi7buh Design Patterns in Java :- https://bit.ly/3MocXiq Docker :- https://bit.ly/3xjWzLA Blockchain Tutorial :- https://bit.ly/3NSbOkc Corda Tutorial:- https://bit.ly/3thbUKa Hyperledger Fabric :- https://bit.ly/38RZCRB NoSQL Tutorial :- https://bit.ly/3aJpRuc Mysql Tutorial :- https://bit.ly/3thpr4L Data Structures using Java :- https://bit.ly/3MuJa7S Git Tutorial :- https://bit.ly/3NXyCPu Donation: PayPal Id : navinreddy20 https://www.telusko.com

#27 Need of an Array in Java

#34 What is String in Java

#37 Static Variable in Java

Java If-Else Statements Explained | Decision Making in Java for Beginners

Volatile Keyword in Java Tutorial - The Fix for Impossible Bugs

#23 JDK JRE JVM in Java

What is JVM? Heap Dump, Thread Dump, Garbage Collection, GC Logs? | JVM Tuning

#24 Methods in Java

#40 Encapsulation in Java

#52 Method Overriding in Java

Building the PERFECT Linux PC with Linus Torvalds

#25 Method Overloading in Java

Do Google engineers actually vibe code?

Why The Russian Accent Terrifies Everyone

Java Strings are Immutable - Here's What That Actually Means

It finally happened

The Crystal That Could Destroy All Medicine

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup

