Design Pattern 11-Adapter

xiaoxiao2021-03-06  58

Using system;

Namespace pattern {///

/// summary description for class1. /// public class adapter: Circle, Draw {public adapter () {// // Todo: add constructor logic here //} Public void Drawequal () {system.console.writeline ("Draw Equal");}} public class circle {public circle () {} public void Drawcircle () {system.console.writeline ("DRAW CIRCLE");}} Public interface draw {void drawcircle (); void drawEqual ();

} // Adapter mode // adapter a = new adapter (); // a.drawcircle (); // a.drawequal ();

转载请注明原文地址:https://www.9cbs.com/read-111838.html

New Post(0)