- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 119字
- 2021-07-02 15:29:16
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.
推薦閱讀
- 多媒體CAI課件設計與制作導論(第二版)
- Web Application Development with R Using Shiny(Second Edition)
- HDInsight Essentials(Second Edition)
- Scala編程實戰(原書第2版)
- 從零開始學C#
- 小程序,巧應用:微信小程序開發實戰(第2版)
- 軟件測試教程
- Regression Analysis with Python
- Django 5企業級Web應用開發實戰(視頻教學版)
- Keil Cx51 V7.0單片機高級語言編程與μVision2應用實踐
- C語言程序設計
- ASP.NET jQuery Cookbook(Second Edition)
- C#編程魔法書
- Building RESTful Web Services with PHP 7
- 趣學Python游戲編程