I'm having trouble understanding the correct ways to declare a linked list. I read online that all of the following syntaxes are correct:
LinkedList<Integer> list1 = new LinkedList<Integer>();
List<Integer> list2 = new LinkedList<Integer>();
Why is this the case? Are there any differences between them, or will they all create the same list?