Last active
October 25, 2023 22:24
-
-
Save ochsec/7343813b13386da6c6ad535af212bebd to your computer and use it in GitHub Desktop.
McNull
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| class McNull | |
| { | |
| public string foo { get; set; } | |
| public int bar { get; set; } | |
| public List<int> baz { get; set; } | |
| public McNull(int aBar) | |
| { | |
| bar = aBar; | |
| baz = new List<int>(); | |
| } | |
| } | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| // Create an instance of McNull with aBar = 42 | |
| McNull mcNull = new McNull(42); | |
| // Set the foo property | |
| // actually, I forgot | |
| // Add some values to the baz list | |
| mcNull.baz.Add(1); | |
| mcNull.baz.Add(2); | |
| mcNull.baz.Add(3); | |
| var emporersNewProp = mcNull.foo; | |
| // Print the values of the emperorsNewProp | |
| Console.WriteLine("emporersNewProp: " + emporersNewProp); | |
| } | |
| } |
This file contains hidden or 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
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <OutputType>Exe</OutputType> | |
| <TargetFramework>net7.0</TargetFramework> | |
| <ImplicitUsings>enable</ImplicitUsings> | |
| <Nullable>enable</Nullable> | |
| </PropertyGroup> | |
| </Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment