2
Answers

Class Inheritance

Seshadri M

Seshadri M

7y
216
1

class Baseclass
{
int i;
public Baseclass(int ii)
{
i = ii;
Console.Write("Base \n");
}
}
class Derived : Baseclass
{
public Derived(int ii)
{
Console.Write("Derived \n");
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Derived d = new Derived(10);
}
}
 
I am getting output as Derived
but i need to get output 
 
Base
Derived 

Answers (2)