class Program {
static bool? a = null;
static bool b = false;
static void Main( string[] args ) {
//1
if( a!=null ) {
b = (bool) a;
}
//2
if( a!=null && (b=(bool) a) ) { }
}
}
Is there any difference between the case #1 and the case #2?
In terms of the value
bwill get, they are functionally the same.Though, since you are using nullables, you should be using their features: