Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void PrintStars(object o)
- {
- if (o is null) return; // constant pattern "null"
- if (!(o is int i)) return; // type pattern "int i"
- WriteLine(new string('*', i));
- }
- public static bool Equals(Object objA, Object objB)
- {
- if (objA == objB)
- {
- return true;
- }
- if (objA == null || objB == null)
- {
- return false;
- }
- return objA.Equals(objB);
- }
- int? a = null;
- if (a is null) { /* */ }
Add Comment
Please, Sign In to add comment