Gox is right:
public Deck split(int n) {
//implement
LinkedList<Card> linkedlist= new LinkedList<Card>();
LinkedList<Card> linkedlist2= new LinkedList<Card>();
int i = n;
while (i > 0){
linkedlist2.add(linkedlist.get(0));
linkedlist.remove(0);
i--;
}
You could also change it to
linkedlist2.add(linkedlist.poll());
There are a whole bunch of different ways to do it so I suggest looking at the
API