[Solved] When I try to add Strings to an Array List I get an “illegal start of type error”
[ad_1] To add items to a static list you can use the block static{} public class Employee { …. private static ArrayList <String> employeeID = new ArrayList <String> (); static { employeeID.add(“632584”); employeeID.add(“259415”); employeeID.add(“257412”); employeeID.add(“953647”); employeeID.add(“126497”); employeeID.add(“453256”); employeeID.add(“125689”); } … } } Or use constructor public class Employee { …. private static ArrayList <String> employeeID … Read more