Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Null-object/C-sharp/null-object-1.cs
Normal file
2
Task/Null-object/C-sharp/null-object-1.cs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
if (foo == null)
|
||||
Console.WriteLine("foo is null");
|
||||
2
Task/Null-object/C-sharp/null-object-2.cs
Normal file
2
Task/Null-object/C-sharp/null-object-2.cs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
int? x = 12;
|
||||
x = null;
|
||||
8
Task/Null-object/C-sharp/null-object-3.cs
Normal file
8
Task/Null-object/C-sharp/null-object-3.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Console.WriteLine(name ?? "Name not specified");
|
||||
|
||||
//Without the null coalescing operator, this would instead be written as:
|
||||
//if(name == null){
|
||||
// Console.WriteLine("Name not specified");
|
||||
//}else{
|
||||
// Console.WriteLine(name);
|
||||
//}
|
||||
Loading…
Add table
Add a link
Reference in a new issue