I'm getting used to java again and was experimenting with collections. I have the following very basic code but I can't seem to find the reason why I get an Nullpointer exception:
import java.util.*;
public class Event
{
private ArrayList<String> fans;
public Event()
{
ArrayList<String> fans = new ArrayList<String>();
}
public void registerUser(String user)
{
fans.add(user);
}
}
Thanks in advance everyone!