How to use an Array list of classes inside a class?

I have a class Map, that has an array of classes Platform inside. My problem is when trying to access the information in the platform class I get this error:

 BCE0019: 'ID' is not a member of 'Object'. 

Here is the code:

class Platform {

    var ID : int;

    function Platform( thisID : int ){

        ID = thisID;


class Map {

    var platforms = new ArrayList();


var thisMap = new Map();
thisMap.platforms.Add(new Platform(1)); 

//Now if I try to access this information I recieve the error:

I’m not sure why I’m getting this error and couldn’t find anything on the internet so any help would be great!

It is a typing issue you could get around by casting. But I recommend using a generic list instead

class Map {
    List<Platform> platforms = new List<Platform>();

In addition, you will have to do as @kilian277 suggests and make ID public.