What is the main difference between Array and Hashmap in java? : <p>In Java, Array and HashMap are used as collections.But I couldn't understand in which situations we should use Array and which time to use HashMap. 
What is the major difference between both of them?
I'm confused about the difference between the Array and HashMap.</p>

<p>Can anyone explain this to me?</p>
