https://www.youtube.com/watch?v=N4u2yQji4ec&list=PLO56HZSjrPTB4NxAsEP8HRk6YKBDLbp7m&index=68
using System;
using static System.Console;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace testProject
{
// 인터페이스
public interface ICarStandard
{
void Left();
}
// 추상 클래스
abstract class KS
{
public abstract void Back();
}
// 부분 클래스
partial class MyCar : KS
{
public override void Back() => WriteLine("후진");
}
partial class MyCar
{
public void Right() => WriteLine("우회전");
}
// 봉인 클래스
sealed class Car : MyCar, ICarStandard
{
public void Left() => WriteLine("좌회전");
public void Run() => WriteLine("직진");
}
// class SpyCar : Car { }
class Program
{
static void Main(string[] args)
{
Car car = new Car();
car.Run();
car.Right();
car.Back();
car.Left();
// SpyCar spy = new SpyCar();
// spy.Run();
}
}
}