https://www.youtube.com/watch?v=UubMVC3EmyQ&list=PLO56HZSjrPTB4NxAsEP8HRk6YKBDLbp7m&index=67
using System;
using static System.Console;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace testProject
{
class Parent
{
protected void Say() => WriteLine("부모_안녕하세요");
protected void Rum() => WriteLine("부모_달리다");
public virtual void Walk() => WriteLine("부모_걷다");
public virtual void Work() => WriteLine("부모_프로그래머");
}
class Child : Parent
{
public void Say() => WriteLine("자식_안녕하세요");
public new void Rum() => WriteLine("자식_달리다");
public override void Walk() => base.Walk();
public override void Work() => Write("자식_프로게이머");
}
class Program
{
static void Main(string[] args)
{
Child child = new Child();
child.Say();
child.Rum();
child.Walk();
child.Work();
}
}
}