MCQs > IT & Programming > C# > Consider the following code: public class ClassPoint { public int X; public int Y; public ClassPoint(int a, int b) { X = a; Y = b; } } public struct StructPoint { public int X; public int Y; public StructPoint(int a, int b) { X = a; Y = b; } } public class Test { static void Main(string[] args) { ClassPoint a = new ClassPoint(10, 10); ClassPoint b = a; a.X = 100; StructPoint c = new StructPoint(10, 10); StructPoint d = c; c.X = 100; Console.WriteLine(b.X.ToString() + ',' + d.X); } } What will be the output printed on the screen?

C# MCQs

Consider the following code:

public class ClassPoint

{

    public int X;

    public int Y;

 

    public ClassPoint(int a, int b)

    {

        X = a;

        Y = b;

    }

}

public struct StructPoint

{

    public int X;

    public int Y;

 

    public StructPoint(int a, int b)

    {

        X = a;

        Y = b;

    }

}

 

public class Test

{

    static void Main(string[] args)

    {

        ClassPoint a = new ClassPoint(10, 10);

        ClassPoint b = a;

        a.X = 100;

        StructPoint c = new StructPoint(10, 10);

        StructPoint d = c;

        c.X = 100;

        Console.WriteLine(b.X.ToString() + "," + d.X);

    }

}

What will be the output printed on the screen?

Answer

Correct Answer: 100 ,10

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

search

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it