When would you not use Generic Collections?

前端 未结 8 1882
醉酒成梦
醉酒成梦 2021-01-19 00:57

The advantage of using generics is that it increases the type safety - you can only put in the correct type of thing, and you get out the correct type without requiring a ca

8条回答
  •  我在风中等你
    2021-01-19 01:43

    The obvious other reason is working with code (possibly legacy) that does not use generic collections.

    You can see this happening in .NET itself. System.Windows.Form.Control.Controls is not generic, nor is System.Web.UI.Control.Controls.

提交回复
热议问题