Polymorphic call
Posted
by harigm
on Stack Overflow
See other posts from Stack Overflow
or by harigm
Published on 2010-03-16T03:00:50Z
Indexed on
2010/03/16
9:56 UTC
Read the original article
Hit count: 426
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?
© Stack Overflow or respective owner