码迷,mamicode.com
首页 > 其他好文 > 详细

List<T> or IList<T>

时间:2019-10-28 21:16:18      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:diff   col   inter   --   val   div   count   ant   answer   

 

If you are exposing your class through a library that others will use, you generally want to expose it via interfaces rather than concrete implementations. This will help if you decide to change the implementation of your class later to use a different concrete class. In that case the users of your library won‘t need to update their code since the interface doesn‘t change.

If you are just using it internally, you may not care so much, and using List<T> may be ok.

List<T> or IList<T>

标签:diff   col   inter   --   val   div   count   ant   answer   

原文地址:https://www.cnblogs.com/dayang12525/p/11755303.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!