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

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.

主站蜘蛛池模板: 大丰市| 霍山县| 江都市| 花垣县| 叶城县| 绥德县| 农安县| 益阳市| 宁远县| 颍上县| 延寿县| 永平县| 白城市| 玉树县| 蓬溪县| 襄垣县| 呼玛县| 虎林市| 谢通门县| 九寨沟县| 滨州市| 于都县| 大埔区| 贵州省| 甘泉县| 昌乐县| 东海县| 将乐县| 应城市| 郎溪县| 舞钢市| 渝中区| 清苑县| 德清县| 米脂县| 天镇县| 达拉特旗| 庆云县| 钦州市| 吉安市| 贵德县|