I am new to java and have a question
myBooks = new ArrayList<HashMap<String,Object>>();
What is HashMap and what does it mean when we use < > for ArrayList class?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both
HashMapandArrayListcan be considered as array in PHP.ArrayListis indexed by number, andHashMapis collection of key value pairs – PHP does not differentiate those two situations.This particular declaration says that there is an
ArrayList(number indexed array) and all its element are of typeHashMap. For eachHashMap, which is a collection of key/value pairs, the keys are of typeString, and values are of typeObject.