List<T> grades = new List<T>();
Sidenote: If this is the first time you’re seeing the it’s a generic type parameter, meaning you can fill in that parameter with any type recognized by the compiler like string or double.
Lists do obviously come with a higher memory cost than normal arrays but solves our issue of needing to know how many items are going to be in our array if you’re not sure . My favorite thing about using these built in data structures is that they come with methods built in as well. You can easily implement a binary search on a list by calling .BinarySearch() on the List object instance.