repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2007-05-25 Jonathan Chambers <joncham@gmail.com>
[mcs.git]
/
tests
/
gtest-006.cs
blob
5faf6e91ebc6dff007ac0143c3faf65ec1ce2d47
1
// Using an array of a type parameter.
2
3
class
Stack
<
T
>
4
{
5
int
size
;
6
T
[]
data
;
7
8
public
Stack
()
9
{
10
data
=
new
T
[
200
];
11
}
12
13
public void
Push
(
T item
)
14
{
15
data
[
size
++] =
item
;
16
}
17
18
public
T
Pop
()
19
{
20
return
data
[--
size
];
21
}
22
23
public void
Hello
(
T t
)
24
{
25
System
.
Console
.
WriteLine
(
"Hello:
{0}
"
,
t
);
26
}
27
}
28
29
class
Test
30
{
31
static void
Main
()
32
{
33
}
34
}