Skip to content

Commit 5f6cdd6

Browse files
get rid of warnings with not used variables
1 parent aa7a66f commit 5f6cdd6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

1_CS/CoreCSharp/NullableReferenceTypes/Program.cs

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
string title = b2.Title;
2121
string? publisher = b2.Publisher;
2222

23+
Console.WriteLine(title);
24+
Console.WriteLine(publisher);
25+
Console.WriteLine(b1);
2326

2427
class Book
2528
{
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
int j = 20;
22
for (int i = 0; i < 10; i++)
33
{
4-
int j = 30; // Can't do this — j is still in scope
4+
// int j = 30; // Can't do this — j is still in scope - uncomment to get the compilation error
55
Console.WriteLine(j + i);
66
}

0 commit comments

Comments
 (0)