Hi,
I'm trying to do something pretty straightforward (I think) but it's not working for me for some reason. Basically trying to create an object with an ArrayList as a attribute but i keep getting numerous errors saying '<identifier> expected', '; expected'.
My code is as follows:
import java.util.ArrayList;
public class testALObject
{
public String surname;
public ArrayList<String>() firstname;
public testALObject()
{
}
}
I haven't even put anything in the constructor as can't get past the first line. I've coded plenty of Objects before but never used an ArrayList so can't figure out where I'm going wrong?
Any help would be greatly appreciated!