Skip to content

Instantly share code, notes, and snippets.

@onlyforbopi
Created July 2, 2021 21:56
Show Gist options
  • Select an option

  • Save onlyforbopi/d61282b1433b59164f9f303637a924ab to your computer and use it in GitHub Desktop.

Select an option

Save onlyforbopi/d61282b1433b59164f9f303637a924ab to your computer and use it in GitHub Desktop.

Revisions

  1. onlyforbopi revised this gist Jul 2, 2021. No changes.
  2. onlyforbopi created this gist Jul 2, 2021.
    11 changes: 11 additions & 0 deletions Dump
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    1. List of anything

    You can specify not only custom types. List<int>, List<double>,
    List<string> will works as well. If you need to store mixed types -
    you need to specify closest base class for all types.
    In List<object> can be stored instance of any type.

    If you are willing to give away type safety you can use an ArrayList,
    which was the only way to use a list of stuff pre generics.

    https://stackoverflow.com/questions/9184764/storing-different-types-inside-a-list