Interfaces, casting, and is: Making classes keep their promises - class diagrams
Head First C Sharp: A Learner’s Guide to Real-World Programming with C Sharp and .NET (Andrew Stellman(著)、Jennifer Greene(著)、O’Reilly Media)の Chapter 7(Interfaces, casting, and is: Making classes keep their promises)、p.363(Sharpen your pencil)の解答を求めてみる。
コード
Program.cs
// 2)
abstract class Top { }
class Tip : Top { }
// 3)
abstract class Fee { }
abstract class Fi : Fee { }
// 4)
interface IFoo { }
class Bar : IFoo { }
class Baz : Bar { }
// 5)
interface IZeta { }
interface IBeta { }
class Alpha : IZeta { }
class Delta : Alpha, IBeta { }