using System;
namespace GenericsExample {
// stack for FLOAT
class MyFLOATStack // Stack for floats
{
int StackPointer = 0;
float [] StackArray; // Array of float
public void Push( float x ) // Input type: float
//...
}
public float Pop() // Return type: int
// stack for INT
class MyINTStack // Stack for ints
int [] StackArray; // Array of int
public void Push( int x ) // Input type: int
public int Pop() // Return type: int
// stack for ALL TYPES
class MyOBJECTStack // Stack for object
object [] StackArray; // Array of object
public void Push( int x ) // Input type: object
public int Pop() // Return type: object