Learned about passing arrays as arguments in Java, a key concept for references.

🚀 #100DaysOfDSA — Day 26/100 Topic: Arrays as Function Arguments in Java 💻 💡 What I Did Today: Today, I learned how arrays can be passed as arguments to functions in Java — and how changes made inside a function affect the original array. This concept is super important for understanding how references work in Java! ⚙️ 🧠 Logic Used: Defined an update() function that increases every array element by 1. Passed the marks[] array into the function. Observed that updates inside the function reflected in the original array — proving arrays are passed by reference (not by value). 📊 Output: Before update → 66 68 72 68 74 After update → 67 69 73 69 75 ✨ Takeaway: Today’s practice gave me clarity on how data moves between methods in Java. Understanding references helps avoid unexpected behavior and write cleaner, safer code 💡 #100DaysOfCode #Day26 #Java #DSA #Arrays #ProblemSolving #CodingJourney #LearnInPublic #CodeNewbie #DeveloperLife

  • text

To view or add a comment, sign in

Explore content categories