Day 8 – Java | Pass by Value & Object Reference Behavior 🚀 Today’s learning at Tap Academy focused on how Java passes data to methods and how memory plays a key role in this behavior. I learned that Java always follows pass by value, but the outcome differs based on what is passed: For primitive data types, a copy of the value is passed, so changes inside a method do not affect the original variable. For objects, a copy of the reference is passed. Multiple references can point to the same object in heap memory, so changes made using one reference are reflected through others. Key takeaways: Difference between changing an object’s state vs changing the reference How stack and heap memory work together during method calls Why object data changes but primitive values don’t This session clarified one of the most commonly misunderstood concepts in Java and strengthened my understanding of memory management and OOP fundamentals. #Java #OOPS #PassByValue #ObjectReference #HeapMemory #StackMemory #TapAcademy #LearningJourney #Day8
Java Pass by Value & Object Reference Behavior
More Relevant Posts
-
🚀 Day 7 – Understanding Methods in Java Today I focused on one of the most important concepts in Java — Methods. While it may seem like a basic topic, methods are the foundation of writing clean, reusable, and modular code. 📌 What I Worked On: • Created methods with and without return types • Passed parameters to methods • Returned values using return keyword • Practiced calling methods from the main() method • Built small programs like: Addition of two numbers Even/Odd checker Greeting user using parameters 🔎 Key Learning Outcomes: ✔ Understood how methods improve code reusability ✔ Learned the difference between void methods and value-returning methods ✔ Practiced writing modular code instead of everything inside main() ✔ Strengthened problem-solving by breaking logic into smaller functions This session helped me understand how structured programming works and why modular design is critical in real-world applications. #100DaysOfCode #Java #OOP #ProgrammingFundamentals #JavaDeveloper #SoftwareDevelopment #LearningInPublic #CodeNewbie
To view or add a comment, sign in
-
-
🚀 Java Series | Day 7/100 📌 Understanding Variables: Scope & Memory Today’s Java learning helped me clearly understand how variables behave based on where they are declared and how memory is allocated. This concept removed a lot of confusion around scope, lifetime, and data sharing in Java. 🔹 Why Variables Matter Variables control how data flows in a program. Choosing the right type of variable improves: ✔ Performance ✔ Readability ✔ Maintainability 🔹 Scope & Lifetime in Java 🔸 Local Variables Exist only during method execution. Memory is released once the method ends. 🔸 Instance Variables Live as long as the object exists and represent the object’s state. 🔸 Static Variables Belong to the class and are shared across all objects, helping reduce memory usage. ✨ Key Takeaway Knowing when a variable is created and destroyed is as important as knowing where it is declared. 📈 Building strong Java fundamentals today for scalable applications tomorrow. #Java #CoreJava #JavaLearning #100DaysOfJava #Programming #SoftwareDevelopment #LearningJourney #Developer # Meghana M # 10000 Coders
To view or add a comment, sign in
-
Day 12 – Learning Java Full Stack. Today’s topic was one of the most important concepts in Java — Methods. A method is a named block of reusable code that performs a specific task. Instead of writing the same logic again and again, we can define it once and call it whenever needed. Structure of a Method- Creating a method involves two parts: 1️⃣ Method Declaration 2️⃣ Method Definition General Syntax: access_modifier modifier return_type methodName(arguments) { // method body } Key Points to Learn: A method must be declared inside a class A method executes only when it is called The same method can be called multiple times A class can contain multiple methods Methods improve modularity and reusability They make programs easier to read, maintain, and modify. 📌 Key Takeaway: Methods are the foundation of structured programming. Without methods, building scalable applications would be difficult. #Java #JavaFullStack #MethodsInJava #ProgrammingBasics #LearningInPublic #CoreJava
To view or add a comment, sign in
-
-
🚀 Day 14 | Core Java Learning 📅 27/01/2026 Today’s session was all about one of the most important foundation concepts in Java: 🔹 Pass By Value 🔹 Pass By Reference Understanding these concepts is crucial before moving deeper into Object-Oriented Programming, as they explain how Java handles primitive data types vs objects, memory behavior, and method calls. 📌 Key Takeaways: Primitive data types work on pass by value Objects work using reference (address) sharing Java is always pass by value, but for objects, the value passed is the reference Multiple references can point to the same object, causing changes to reflect everywhere Grateful to Tap Academy for the clear explanations and practical examples that make learning Java easier and more interesting. 💡💻 Step by step, building a strong foundation in Core Java. 🔖 Hashtags: #Day14 #CoreJava #PassByValue #PassByReference #JavaProgramming #ObjectOrientedProgramming #TapAcademy #JavaLearner #FullStackDevelopment #LearningJourney #JavaBasics #ProgrammingConcepts
To view or add a comment, sign in
-
-
DAY 11: CORE JAVA 🔹 Understanding Variables in Java & Memory Allocation in JRE While learning Java, one concept that truly strengthened my foundation is understanding how variables work and how memory is allocated inside the JRE. 📌 Types of Variables in Java: 1️⃣ Local Variables Declared inside methods, constructors, or blocks Stored in Stack Memory Exist only during method execution 2️⃣ Instance Variables Declared inside a class but outside methods Stored in Heap Memory Each object gets its own copy 🧠 How Memory is Allocated in JRE When a Java program runs, memory is divided mainly into: 🔹 Stack Memory Stores method calls, local variables Works in LIFO (Last In First Out) order Automatically cleared after method execution 🔹 Heap Memory Stores objects and instance variables Managed by Garbage Collector Objects remain until no longer reference 💡 Why This Matters Understanding memory allocation helps in: ✔ Writing optimized code ✔ Avoiding memory leaks ✔ Understanding stack overflow errors ✔ Building strong OOP fundamentals Learning these internal concepts makes Java much more logical and structured rather than just syntax-based coding. TAP Academy #Java #Programming #OOP #LearningJourney #SoftwareDevelopment #CoreJava
To view or add a comment, sign in
-
-
🚀 Stepping Deeper into Core Java – Constructor Chaining Today I strengthened my understanding of constructors and how they play a crucial role in object initialization. A constructor is a special method that is automatically executed when an object is created, ensuring that the object begins with the right data. I then explored Constructor Chaining, a smart technique where one constructor calls another within the same class using this(). This approach helps reduce code duplication, improves readability, and promotes cleaner object-oriented design📚. Implementing this concept gave me clearer insight into how Java handles efficient object creation and structured programming. Consistent learning, hands-on practice, and building strong fundamentals — one concept at a time. Every new concept is helping me build a stronger foundation in object-oriented programming💡. Onward to mastering Core Java 📈 📈 #Java #OOPS #ConstructorChaining #Programming #LearningJourney #CoreJava
To view or add a comment, sign in
-
-
As part of my Core Java learning @ TAP Academy, Today I learned different types of arrays and their structure and disadvantage of arrays. 🔹 1️⃣ Regular (Rectangular) Array All rows have the same number of columns. Memory structure is fixed and uniform. Example: int[][] arr = new int[3][3]; 🔹 2️⃣ Jagged Array Rows can have different numbers of columns. Memory is allocated dynamically for each row. Example: int[][] arr = new int[3][]; arr[0] = new int[2]; arr[1] = new int[4]; arr[2] = new int[3]; 🔎 Disadvantages of Arrays: • Fixed size (cannot grow or shrink after creation) • Stores only homogeneous data (same data type) • Insertion and deletion operations are costly • Memory may be wasted if size is not properly utilized Understanding these concepts helps in choosing the right data structure for efficient programming. TAP Academy #Java #CoreJava #Arrays #DataStructures #FullStackDeveloper #LearningJourney
To view or add a comment, sign in
-
-
My first post on LinkedIn, and I’ve been thinking about what I should share 🤔 For the past couple of months, I have been learning and working with Java. Recently, Coder Army has launched a Java course where Aditya Sir is teaching Java and so in great depth, and the learnings from the first lecture were truly amazing and I am sharing them as my first post. One question that stood out to me was: When C and C++ already existed, what problem was Java trying to solve? Here’s what I learned: Portability: 🚙 C/C++ programs are platform-dependent, meaning the same code must be compiled separately for different platforms. Java solved this using the JVM (Java Virtual Machine). Flow: Java Source Code → Compiler → Bytecode → JVM (on different platforms) → Machine Code This allows Java to follow the principle of “Write Once, Run Anywhere.” Simplicity: 😊 Java removed complex concepts like pointers, multiple inheritance, and manual memory deallocation, introducing automatic garbage collection to manage memory efficiently. Security: 🔐 Java was widely used in servers through Servlets and earlier in front-end development using Applets. The JVM ensures that even if someone tries to manipulate bytecode to access unauthorized data, strict security checks prevent such actions. Excited to keep learning and sharing more from this journey 🚀 #Java #Learning #CodingJourney #Programming #CoderArmy
To view or add a comment, sign in
-
Day 10 – Learning Java Full Stack Today let's learn about While Loop. The while loop is used when we want to execute a block of code repeatedly as long as a condition is true. Syntax: while (condition) { // loop body } The loop keeps running until the condition becomes false. Example: int a = 1; while (a <= 5) { System.out.println("JAVA"); a++; } Execution Flow: When a = 1 → JAVA When a = 2 → JAVA When a = 3 → JAVA When a = 4 → JAVA When a = 5 → JAVA When a = 6 → Condition becomes false → Loop terminates Key takeaway: A while loop is condition-based repetition. If the condition never becomes false, it can lead to an infinite loop — so updating the variable is very important. More learning updates coming soon #Java #JavaFullStack #WhileLoop #ControlStatements #LearningInPublic #CoreJava
To view or add a comment, sign in
-
🚀 A tiny Java line that unlocked BIG OOP clarity for me 🤔 What happens when we try to print an object created using OOPs in java? I tried to execute this java program which might look simple at first glance. I realized how much depth is hidden behind this simple statement: System.out.println(c1); and its output: calculator@731f8236 At first glance, it looks weird. But digging deeper taught me some core Java & OOP truths 👇 🔹 c1 is not the object — it’s a reference 🔹 Printing an object automatically calls toString() 🔹 calculator@731f8236 is not a memory address, but an identity string 🔹 Every class in Java silently extends Object 🔹 Meaningful output requires overriding toString() 🔹 Objects have identity + behavior, not just data 💡 The biggest mindset shift: Console output is representation, not reality. Method calls use references, not printed text. This single experiment connected: Stack vs Heap Reference vs Object Why c1.mul() works Why calculator@731f8236.mul() can never work 📚 These are the moments where OOP stops being syntax and starts making sense. If you’re learning Java and ever wondered “what exactly is an object?” — you’re not alone 🙂 Would love to hear: 👉 What was the ONE line of code that gave you an “aha!” moment in programming? #Java #OOP #LearningByDoing #ProgrammingConcepts #CSFundamentals #StudentDeveloper #DebuggingMindset #JavaBeginners
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development