- 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.
推薦閱讀
- scikit-learn Cookbook
- JavaScript百煉成仙
- Visual C++程序設計教程
- Python科學計算(第2版)
- Vue.js快速入門與深入實戰(zhàn)
- 深入淺出Windows API程序設計:編程基礎篇
- STM32F0實戰(zhàn):基于HAL庫開發(fā)
- Java程序設計
- Principles of Strategic Data Science
- 人人都能開發(fā)RPA機器人:UiPath從入門到實戰(zhàn)
- 官方 Scratch 3.0 編程趣味卡:讓孩子們愛上編程(全彩)
- SAS編程演義
- Mastering Data Analysis with R
- 前端Serverless:面向全棧的無服務器架構(gòu)實戰(zhàn)
- Python程序員面試算法寶典