Well, turingmachine completely ignored the question.
Just return an empty list
return new LinkedList<names>();
or you could also define an empty list class constant to use for that purpose
public final static LinkedList<names> EMPTY_LIST = new LinkedList<names>();
A couple of additional thoughts:
- Do you really need to return a LinkedList? It's usually better to use the interface List, so as not to nail yourself to using a particular list class.
- Why is "names" lowercase? Class names should begin with a capital.
- The EMPTY_LIST should probably be unmodifiable unless you explicitly expect callers to add data to that list, which is probably not a good idea anyway
public final static List<names> EMPTY_LIST = Collections.unmodifiableList(new LinkedList<names>());