This question has already been answered:
- Type casting 5 answers
from Collection collection = new ArrayList ();
This question has already been answered:
from Collection collection = new ArrayList ();
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
Comparing
ArrayList ArList = new ArrayList(); and
Collection<String> collection = new ArrayList<String>(); we will find small differences:
new ArrayList() is the same as new ArrayList<Object>()In more detail you learn from the documentation .
Source: https://ru.stackoverflow.com/questions/584846/
All Articles