using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConstructCallVirtual
{
class Program
{
static void Main(string[] args)
{
B b=new B();
}
}
class A
{
public A()
{
Console.WriteLine("A()");
DoSth();
}
public virtual void DoSth()
{
Console.WriteLine("A::DoSth()");
}
}
class B:A
{
public B()
{
Console.WriteLine("B()");
DoSth();
}
public virtual void DoSth()
{
Console.WriteLine("B::DoSth()");
}
}
//A()
//A::DoSth()
//B()
//B::DoSth()
//
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConstructCallVirtual
{
class Program
{
static void Main(string[] args)
{
B b=new B();
}
}
class A
{
public A()
{
Console.WriteLine("A()");
DoSth();
}
public virtual void DoSth()
{
Console.WriteLine("A::DoSth()");
}
}
class B:A
{
public B()
{
Console.WriteLine("B()");
DoSth();
}
public override void DoSth()
{
Console.WriteLine("B::DoSth()");
}
}
//A()
//B::DoSth()
//B()
//B::DoSth()
//
}