using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace @abstract
{
class Program
{
static void Main(string[] args)
{
RealizeTest reTest = new RealizeTest();
reTest.test_1();
reTest.test_2();
}
}
/// <summary>
/// 抽象类
/// </summary>
abstract class test
{
/// <summary>
/// 抽象方法
/// </summary>
abstract public void test_1 ();
/// <summary>
/// 虚方法
/// </summary>
virtual public void test_2()
{
Console.WriteLine("星期二");
}
}
class RealizeTest : test
{
public override void test_1()
{
Console.WriteLine("星期一");
}
public override void test_2()
{
Console.WriteLine("星期二二");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace @abstract
{
class Program
{
static void Main(string[] args)
{
RealizeTest reTest = new RealizeTest();
reTest.test_1();
reTest.test_2();
}
}
/// <summary>
/// 抽象类
/// </summary>
abstract class test
{
/// <summary>
/// 抽象方法
/// </summary>
abstract public void test_1 ();
/// <summary>
/// 虚方法
/// </summary>
virtual public void test_2()
{
Console.WriteLine("星期二");
}
}
class RealizeTest : test
{
public override void test_1()
{
Console.WriteLine("星期一");
}
public override void test_2()
{
Console.WriteLine("星期二二");
}
}
}