官术网_书友最值得收藏!

Summary

In this chapter, you learned about the basics of making a simple generic class, so that one class can operate on many different data types. A great benefit of generics is flexibility. You created a simple generics class that worked with different data types, made generic parameters, initialized a collection of integers to their array and displayed the results, and then changed the data types in the generics class to doubles and decimals.

In the next chapter, you will learn about generic methods, or methods that can operate on different data types. You will also learn about constraining a method in terms of the data types that it can operate on, so we'll add a concept called constraints.

主站蜘蛛池模板: 甘南县| 沂源县| 廊坊市| 广平县| 五指山市| 蓬莱市| 布拖县| 图片| 金坛市| 同仁县| 淮南市| 新乡县| 阳谷县| 惠州市| 光山县| 简阳市| 中宁县| 奉化市| 玉山县| 临颍县| 克东县| 崇明县| 白山市| 宿迁市| 沽源县| 岳普湖县| 洪泽县| 敖汉旗| 忻州市| 化州市| 新沂市| 柞水县| 巴马| 开江县| 天峨县| 淄博市| 中宁县| 常德市| 中阳县| 新泰市| 赫章县|