Last active
September 2, 2021 14:22
-
-
Save renestein/c861c8bc1b1407196ca94b0806f74fa9 to your computer and use it in GitHub Desktop.
GenericNullable1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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