Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 6: Making a value type nullable #79

Open
ghost opened this issue Jun 11, 2022 · 1 comment
Open

Chapter 6: Making a value type nullable #79

ghost opened this issue Jun 11, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 11, 2022

In the step 3 (In Program.cs, type statements to declare and assign values, including null, to int variables, as shown in the following code)

...
int? thisCouldBeNull = null;
WriteLine(thisCouldBeNull);
...

This will give us an error: CS0103 - The name 'WriteLine' does not exist in the current context, we need to import the System.Console in order to use the method WriteLine directly

using static System.Console;

@markjprice
Copy link
Owner

In Chapter 2, on page 87, I say, "Remember to statically import the System.Console type in all future projects to simplify your code, as these instructions will not be repeated every time."

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant