What will be the output of the following C# code?
A. 8, 8
B. 0, 2
C.
D. 7, 8
Code:
class maths
{
public int length;
public int breadth;
public maths(int x)
{
length = x + 1;
}
public maths(int x, int y)
{
length = x + 2;
}
}
class Program
{
static void Main(string[] args)
{
maths m = new maths(6);
maths k = new maths(6, 2);
Console.WriteLine(m.length);
Console.WriteLine(k.length);
Console.ReadLine();
}
}
B. 0, 2
C.
Code:
8, 10