Q:

How do I add a class to an arraylist in processing?

Whenever I try to add a country into my ArrayList<country>  I keep on getting this error: unexpected token: ( and it highlights my countries.add line. I'm not sure why this is happening.
class country  {
    private int mland, mwaters; //mtotalborders;
    private String mcenter;

    country(int earth, int aqua, String yn)  {
        mland = earth;
        mwaters = aqua;
        mcenter = yn;
    }
    public int getLand()  {
        return mland;
    }
    public int getWaters()  {
        return mwaters;
    }
    public int getTotalBorders()  {
        return mland+mwaters;
    }
    public String getCenter()  {
        return mcenter;
    }
}

country Turkey = new country(16, 7, "No");
country France = new country(22, 4, "No");
country England = new country(17, 9, "No");
country Germany = new country(26, 4, "Yes");
country Austria = new country(28, 1, "Yes");
country Italy = new country(17, 8, "Yes");
country Russia = new country(23, 3, "No");
ArrayList<country> countries = new ArrayList<country>();
countries.add(Turkey);

A:

You need to put your code into a method - you probably want to use the main method - see below.
    ......

    public String getCenter()  {
        return mcenter;
    }

    public static void main(String[] args){
        country Turkey = new country(16, 7, "No");
        country France = new country(22, 4, "No");
        country England = new country(17, 9, "No");
        country Germany = new country(26, 4, "Yes");
        country Austria = new country(28, 1, "Yes");
        country Italy = new country(17, 8, "Yes");
        country Russia = new country(23, 3, "No");
        ArrayList<country> countries = new ArrayList<country>();
        countries.add(Turkey);
    }
}

Note:  The proper convention is to capitalize Class names, and have variable names lowercase.
This will require you to change your Class name in your code - see below.
class Country  {
    private int mland, mwaters; //mtotalborders;
    private String mcenter;

    Country(int earth, int aqua, String yn)  {
        ......

Also anytime you reference the Class name.  For example.
Country turkey = new Country(16, 7, "No");

