Thảo Justin
New member
What will be the output of the following C# code?
A. 8,
B. 8
C.
D.
, 8
Code:
namespace ConsoleApplication4
{
class A
{
public int i;
public void display()
{
Console.WriteLine(i);
}
}
class B: A
{
public int j;
public void display()
{
Console.WriteLine(j);
}
}
class Program
{
static void Main(string[] args)
{
B obj = new B();
obj.j = 1;
obj.i = 8;
obj.display();
Console.ReadLine();
}
}
}
Code:
1
C.
Code:
1
Code:
1