c# - What do we mean by ? OR ??? -
someone tell me difference , example why use these. know null values.
there 2 different operator use '?'
conditional operator: condition?then:else if condition true 'then part' else 'else part', operator if-else.
null-coalescing operator: ?? operator called null-coalescing operator , used define default value nullable value types reference types. returns left-hand operand if not null; otherwise returns right operand. // y = x, unless x null, in case y = -1. int y = x ?? -1;
Comments
Post a Comment