static void Main(string[] args) { Dog p = new Puddle(); p.name = "푸들이"; p.jitda(); ((Puddle)p).work(); Dog j = new Jindo(); j.name = "진돌이"; j.jitda(); ((Jindo)j).Run(); }
static void Main(string[] args) { Dog p = new Poodle(); p.Name = "푸들이"; p.jitda(); ((Poodle)p).work(); (p as Poodle).work(); behave(p); Dog j = new Jindo(); j.Name = "진도이"; j.jitda(); ((Jindo)j).run(); behave(j); }