What does the ` character stand for?

written by Ryan Olshan on Tuesday, January 03 2006

Take the following code, for example:

VB.NET
Public Class TestClass(Of T)

End Class

Response.Write(GetType(TestClass(Of Integer)))

C#
public class TestClass<T> { }

Response.Write(typeof(TestClass<int>));

The above code results in the following output: TestClass`1[System.Int32]. The ` next to 1 indicates the arity of the generic class and the 1 after ` means it has an arity of 1. Arity is a term that refers to the number of type parameters used to construct a type.

Kick this post on .NET Kicks

Similar Posts

  1. What's wrong with this generic type?
  2. Generic Sub Classes
  3. Generic Type Inference

Post a comment