Back to articles
πŸš€ Day 29 of My Automation Journey – Arrays (Full Guide + Tricky Questions)
How-ToDevOps

πŸš€ Day 29 of My Automation Journey – Arrays (Full Guide + Tricky Questions)

via Dev.tobala d kaveri

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 & A

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles