Collection Interface
Root interface of collections
Collection Interface
Collection is the root interface for List, Set, and Queue.
Code Examples
Basic Collection usage
java
1
2Collection<String> c = new ArrayList<>();
3c.add("A");
4c.remove("A");
5 Use Cases
- Generic handling
Common Mistakes to Avoid
- Using Collection instead of Map