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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -