Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-006.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5985fa6da29981edbe5d32263bc998ec3246f12d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Using an array of a type parameter.

class Stack<T>
{
	int size;
	T[] data;

	public Stack ()
	{
		data = new T [200];
	}

	public void Push (T item)
	{
		data [size++] = item;
	}

	public T Pop ()
	{
		return data [--size];
	}

	public void Hello (T t)
	{
		System.Console.WriteLine ("Hello: {0}", t);
	}
}

class Test
{
	public static void Main ()
	{
	}
}