🚀 Day 30 of My Automation Journey – Arrays (Full Guide + Tricky Questions)
Today’s learning was one of the most important milestones in my journey 🔥 👉 Arrays (core concept) 👉 JVM internal behaviour 👉 Memory understanding 👉 Tricky interview questions 👉 Deep dive into...

Source: DEV Community
Today’s learning was one of the most important milestones in my journey 🔥 👉 Arrays (core concept) 👉 JVM internal behaviour 👉 Memory understanding 👉 Tricky interview questions 👉 Deep dive into public static void main This is where coding becomes real engineering 🚀 🔹 PART A – ARRAYS COMPLETE THEORY 🔹 1. What is an Array? 👉 An array is an object 👉 It is a container that: ✔ Stores multiple values ✔ Same data type ✔ Fixed size 🔹 2. What Happens Internally (JVM 🔥) int[] arr = {10, 20, 30}; 👉 Internally JVM converts: int[] arr = new int[]{10, 20, 30}; 💡 JVM: Creates object in Heap memory Stores reference in variable 🔹 3. Proof – Array is an Object System.out.println(arr.getClass()); Output: class [I 🔹 4. Array Creation int[] arr1 = {10, 20, 60, 30}; int[] arr2 = new int[5]; 🔹 5. Important Points ⚠️ ✔ Fixed size ✔ Index starts from 0 ✔ Stored in Heap ✔ Default values assigned 🔹 6. Default Values Type Default int 0 boolean false object null 🔹 7. Initialization & Access a