java does a linkedlist have to be a string code example Example: how to declare a linked list in java LinkedList<String> list=new LinkedList<String>();