how to print linked list of any type in java code example Example: how to create a linked list in java List<Integer> list = new LinkedList<>();