MCQs > IT & Programming > C# > 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(); }}

C# MCQs

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();

    }

}

Answer

Correct Answer: 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.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

More C# MCQ Questions

search

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it