Question:What will happen if the following code is compiled in .NET 4 or above (Assume required namespaces are included)?
public class var { } public class main { public static void main(string[] args) { var testVar = new var(); } }
A This code will not compile, as var is a reserved keyword, so it can not be used as a class name.
B This code will compile, as var is merely a contextual keyword and it is used to provide a specific meaning in the code, so it will cause no problems.
C This code will not compile, as a new object cannot be created like var testVar = new var();
D None of these.
+ AnswerB
+ Report