Summary

This chapter has illustrated that collections in .NET are broadly similar to those in Java, although less comprehensive in nature. The most frequently used classes (Hashtable and ArrayList) are almost identical, allowing for basic differences between the Java and C# language.

There are some striking omissions from the .NET class library, most notably support for sets and the base classes for providing least recently used (LRU) maps, such as the LinkedHashMap Java class. However, the ability to treat arrays as collections is a useful feature.

Get C# for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.