I\'m reading book \"the C# programming Language\", 4th Edition, by Anders Hejlsberg etc.
There are several definitions that are a bit twisting:
unbo
An excellent answer is given by Jon, here.
Not giving a technical description since everything is there perfectly in the linked answer. To merely replicate the gist of it as an answer here, it would look like:
A //non generic, bound
A<U, V> //generic, bound, open, constructed
A<int, V> //generic, bound, open, constructed
A<int, int> //generic, bound, closed, constructed
A<,> (used like typeof(A<,>)) //generic, unbound
Edited after discussion with Heinzi.
These are examples of unbound generic types:
List<>
Dictionary<,>
They can be used with typeof
, i.e., the following are valid expressions:
typeof(List<>)
typeof(Dictionary<,>)
That should answer your question 2. With respect to question 1, note that type arguments can be constructed types or type parameters. Thus, your list should be updated as follows:
public class MyClass<T, U> { // declares the type parameters T and U
// all of these are
// - generic,
// - constructed (since two type arguments are supplied), and
// - bound (since they are constructed):
private Dictionary<T, U> var1; // open (since T and U are type parameters)
private Dictionary<T, int> var2; // open (since T is a type parameter)
private Dictionary<int, int> var3; // closed
}