Sorry, I am new to the java., so may be this is a stupid question.But have the doubt for below code -why we write like below- List l=new ArrayList(); //I feel if we write ArrayList l = new ArrayList(), and suppose in future I //changed to LinkedList(), then somemethod() declaration has no impact, // then why we give reference of the interface while we create an object of //class?? someMethod(l);//method call //method declearation someMethod(List l){ //here understood the signifance of List interface,but in above it is not clear //some logic } | 0 |