Skip to content

Instantly share code, notes, and snippets.

@renestein
Last active September 2, 2021 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renestein/c861c8bc1b1407196ca94b0806f74fa9 to your computer and use it in GitHub Desktop.
Save renestein/c861c8bc1b1407196ca94b0806f74fa9 to your computer and use it in GitHub Desktop.
GenericNullable1.cs
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
MyStack<MyItem> stack = new MyStack<MyItem>();
public class MyStack<T> where T : class
{
private T[] _items;
public MyStack()
{
_items = new T[10];
}
public T? Pop()
{
return null;
}
}
public class MyItem
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment