Home > Articles > Programming > Java

  • Print
  • + Share This
Like this article? We recommend Conclusion

Conclusion

This article dug deeper into generics by showing you how to declare a generic Stack type. Using this type as an example, it then explored bounded type parameters, type parameter scope, and wildcard arguments.

Part 3 of this series explores another important generics language feature: generic methods. You learn why generic methods are needed as you explore different versions of a copy() method for copying one collection to another.

Additionally, you learn about generics in the context of arrays, and why, for example, you cannot assign new E[size] to elements in Listing 1’s Stack type.

  • + Share This
  • 🔖 Save To Your Account