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

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.

主站蜘蛛池模板: 萨迦县| 介休市| 大兴区| 庆阳市| 余干县| 合江县| 昭觉县| 霍城县| 辉南县| 鲁山县| 临江市| 新乐市| 文山县| 安吉县| 静安区| 金阳县| 镇赉县| 廉江市| 铅山县| 乐亭县| 扎赉特旗| 益阳市| 汕尾市| 丰都县| 宝坻区| 巴林右旗| 杭锦后旗| 凉山| 时尚| 抚宁县| 巩留县| 玉屏| 华亭县| 页游| 金沙县| 台山市| 五大连池市| 绵阳市| 高邮市| 湟源县| 蕉岭县|