Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Array of Maps without generic or warnings?

843793May 22 2010 — edited May 22 2010
How would I create an array of maps without getting an error about a generic type or a warning?

This will give me an error.
HashMap<Integer,Integer> test = new HashMap<Integer,Integer>[5];
This will give me a warning.
HashMap<Integer,Integer> test = new HashMap[5];

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 19 2010
Added on May 22 2010
3 comments
134 views