static void Main() { Dog p = new Pudle(); p.name = "푸들이"; p.jitda(); ((Pudle)p).work(); }
static void Main() { Dog p = new Pudle(); p.Name = "푸들이"; p.jitda(); //푸들푸들 ((Pudle)p).Work(); Dog j = new Jindo(); j.Name = "진도이"; j.jitda(); //진도진도 ((Jindo)j).Run(); }
static void Main(string[] args) { // 업캐스팅 Dog pudle = new Pudle(); // Pudle pudle = new Pudle(); ((Pudle)pudle).name = "곰둥이"; ((Pudle)pudle).Jitda(); ((Pudle)pudle).Work(); Dog jindo = new Jindo(); ((Pudle)jindo).name = "김용찬"; ((Pudle)jindo).Jitda(); ((Pudle)jindo).Work(); }
static void Main() { Pudle p = new Pudle(); p.name = "푸들이"; p.jitda(); Jindo j = new Jindo(); j.name = "진도이"; j.jitda(); }
static void Main(string[] args) { Dog p = new Pudle(); p.name = "푸들이"; p.jitda(); ((Pudle)p).work(); Dog j = new Jindo(); j.name = "진도이"; j.jitda(); ((Jindo)j).run(); }