I am maintaining some C# code. I see a line of code which seems to be doing a boolean assignment based upon a comparison. I rewrote the code. Is my re-written code lines (10 through 18) the equivalent of lines 1 to 3?
// Before:
1 bool chiso;
2 chiso = aValue == "Yes"
// After :
10 bool chiso = false;
11 if(aValue == "Yes")
12 {
13 chiso = true;
14 }
15 else
16 {
17 chiso = false;
18 }
C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).
TRUSTED BY