Core Java Training TAP Academy: Methods, Stack Frame & Memory Execution

🚀 Day 14 – Core Java Training TAP Academy | Methods, Stack Frame & Memory Execution (Deep Dive) 💻🧠 Good afternoon everyone! Today’s session was a strong reminder that coding is not just about getting output ✅—it’s about understanding what happens inside memory (RAM) while the program runs 🔍⚙️ ✅ What I Learned Today 🧩 1) Quick Revision (Foundation Recap) 📌 OOP Rule: Every object has two parts ✅ State / Properties (HAS-A) → coded using variables & data types ✅ Behavior (DOES) → coded using methods/functions We also revised: 🧠 Data Types + Range + Unicode (char = 2 bytes) 🔁 Type Casting (Implicit & Explicit) 📍 Variables: Instance vs Local 💾 JVM Memory Segments: Code | Stack | Heap | Static ⚙️ 2) Introduction to Methods (Most Important Topic Today) A method is a block of code that performs a specific task ✅ And methods give us one big advantage: 🔥 Code Reusability (no more rewriting logic again & again) 🧠 3) 4 Types of Methods (Method Variations) ✅ No Input – No Output ✅ No Input – Output ✅ Input – No Output ✅ Input – Output Today we focused mainly on the first two types ✅ 🧮 4) Real Example: Calculator add() Method 📌 Learned how to: ✅ Create a method ✅ Call a method using object reference (cc.add()) ✅ Understand printing vs returning 🖨️ Printing: sends output to console ↩️ Returning: sends output back to the caller (main method) 🧠 5) Program Execution in Memory (Stack + Heap) 🔥 This part was the real game-changer ✅ 🧱 Stack Segment When any method runs → its stack frame is created Main method stack frame comes first When another method is called → new stack frame is pushed on top 📌 Follows LIFO: Last In, First Out 🔁 🏗️ Heap Segment Objects are created in Heap Instance variables stay inside the object When reference is removed → object becomes Garbage ♻️ Garbage Collector cleans it automatically 🎯 6) Return Type + Type Casting While Returning ✅ Return type must match returned value ✅ Implicit type casting also works during return Example: int can return into float (Implicit widening) ✅ 📌 Key Takeaway 🔥 ✅ Output is easy. 💡 Understanding RAM execution (stack frame + heap object + GC) is what makes a real Java developer 💪💻 ✅ Task for Me 📌 Start/continue Coding Scenarios in the portal and complete at least till Methods 💪📚 Trainer:Sharath R #TapAcademy #CoreJava #JavaProgramming #OOP #MethodsInJava #StackAndHeap #GarbageCollector #CodingJourney #LearningByDoing #JavaDeveloper #FullStackDeveloper #TechSkills #ProgrammingConcepts 🚀💻

  • graphical user interface, website

To view or add a comment, sign in

Explore content categories