- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 68字
- 2025-04-04 18:04:54
Making parameters that are generic
Now, in the following line, enter the following:
public GenericsClass(T[] input)
As you can see, you can also make parameters that are generic like this one. This is a parameter, input is the name of it, and the type is T. So, it's a generic array.
Next, enter the following between a set of curly braces beneath the preceding line:
vals = input;