# Objects and class objects cannot be converted?

**URL:** <https://discourse.processing.org/t/objects-and-class-objects-cannot-be-converted/17276>\
**Category:** Beginners\
**Created:** [January 23, 2020, 5:05am UTC](https://discourse.processing.org/t/objects-and-class-objects-cannot-be-converted/17276 "2020-01-23T05:05:26Z")\
**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 23, 2020, 5:50am UTC](https://discourse.processing.org/t/objects-and-class-objects-cannot-be-converted/17276/2 "2020-01-23T05:50:36Z")

</div>

Replace `private Map cars = new HashMap();`  
w/ `final Map<String,Car> cars = new HashMap<String,Car>();`

> [@2D Array of TreeMaps wont access the intValue()](https://discourse.processing.org/t/2d-array-of-treemaps-wont-access-the-intvalue/17245/2):
>
> If you know how many you’re gonna need, you can simplify things a lot by choosing a vanilla array. You didn’t specify the generic datatypes for your 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/objects-and-class-objects-cannot-be-converted/17276)._
