My bridge in c #

xiaoxiao2021-03-06  124

// mybridgeusing system;

/ / -------------------------------------------------------------------------------------------- -Class Manager // Parent ClassAbstract Class Manager {// Method: Kickout Abstract Public Void Kickout ();

// sonclass1: FemaleManagerclass FemaleManager: Manager {override public void KickOut () {Console.WriteLine;} ( "Please Go Out!")}; // sonclass2: MaleManagerclass MaleManager: Manager {override public void KickOut () {Console.WriteLine ("OUT! Shit!");}}; // ------------------------------------ ------------- Class Manager // ------------------------------- ---------------- Class Chatroomclass Chatroom {// Manager to Keep The Room Silent: Field Private Manager Chatroommanager;

// Property public manager chatroommanager {set {chatroommanager = value;}}

//Method public void kickout () {chatroommanager.kickout ();}}; // -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------- ---------------------- Testappclass testapp {public static void main (string [] args) {chatroom chatomManager = new femaleManager (); Chatroom.kickout ();

Chatroom.chatroommanager = new malemanager (); chatroom.kickout ();

While (TRUE);

/ / -------------------------------------------------------------------------------------------- -TestApp

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

New Post(0)