Suppose we wanna define and use a LinkedList in our code. I would define it this way:
LinkedList<String> list= new LinkedList<>();
Why some people use the interface List
List<String> list = new LinkedList<>();
to define a LinkedList? What are the advantages?