# 2D Array of TreeMaps wont access the intValue()

**URL:** <https://discourse.processing.org/t/2d-array-of-treemaps-wont-access-the-intvalue/17245>\
**Category:** Beginners\
**Created:** [January 22, 2020, 5:14am UTC](https://discourse.processing.org/t/2d-array-of-treemaps-wont-access-the-intvalue/17245 "2020-01-22T05:14:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [January 22, 2020, 5:36am UTC](https://discourse.processing.org/t/2d-array-of-treemaps-wont-access-the-intvalue/17245/2 "2020-01-22T05:36:41Z")

</div>

> [@tribblesontoast](#):
>
> I have an ArrayList with 7 TreeMaps in it…

If you know how many you’re gonna need, you can simplify things a lot by choosing a vanilla array.

> [@tribblesontoast](#):
>
> … it throws an error telling me that the **intValue()** method doesn’t exist.

You didn’t specify the generic datatypes for your TreeMap:

> [@tribblesontoast](#):
>
> `ArrayList<TreeMap> colourRanges = new ArrayList<TreeMap>();`

Which seems like it is the pair `color` & `int`. So, their corresponding wrapper type is Integer:  
`final TreeMap<Integer, Integer>[] colourRanges = new TreeMap[7];`

---

_[View the full topic](https://discourse.processing.org/t/2d-array-of-treemaps-wont-access-the-intvalue/17245)._
