Polymorphic call
- by harigm
I am new to java, I have seen in the code at many places where my seniors have declared as
List myList = new ArrayList(); (option1)
Instead of
ArrayList myList = new ArrayList(); (option2)
Can you please tell me why people use Option1, is there any advantages?
If we use option2, do we miss out any advantages or features?