2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / tests / gtest-052.cs
blobf2a8441ba6f6fce27ae77d0b4dd6f541eef3beae
1 // We create an instance of a type parameter which has the new() constraint.
2 using System;
4 public class Foo<T>
5 where T : new ()
7 public T Create ()
9 return new T ();
13 class X
15 public X ()
16 { }
18 void Hello ()
20 Console.WriteLine ("Hello World");
23 static void Main ()
25 Foo<X> foo = new Foo<X> ();
26 foo.Create ().Hello ();