The size variable (and loc and type) never get instantiated. You should do so in a constructor, or at least call create or guInterface() on an instance before accessing the variables in readFile