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

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.

主站蜘蛛池模板: 六安市| 兰西县| 基隆市| 清苑县| 旬邑县| 广德县| 临猗县| 双峰县| 西畴县| 乐平市| 屯昌县| 磐石市| 波密县| 海城市| 大洼县| 武穴市| 海南省| 湛江市| 吉首市| 观塘区| 泾川县| 巨鹿县| 凉山| 和政县| 交城县| 克拉玛依市| 清苑县| 皮山县| 平安县| 韶关市| 青州市| 滕州市| 伽师县| 龙里县| 岚皋县| 乌兰察布市| 格尔木市| 高唐县| 灵武市| 望奎县| 双桥区|