A simple single example test

xiaoxiao2021-03-05  18

//Simpleclass.cs:

Using system;

Namespace C {public class simpleclass {private string id; private static simpleclass sc;

Public static simpleclass create () {if (sc == null) {sc = new simpleclass ();

Return SC;

Public void do (string theid) {sc.id = theid;}

Public string id {get {return id;} set {id = value;}}}}

//test:

Using system;

Summary description of Namespace C {///

/// class1. /// class class1 {/// /// The primary entry point of the application. /// [stathread] static void main (string [] args) {c.SIMPLECLASS S = C.SIMPLECLASS.CREATE (); S.DO ("rpy");

System.console.writeline ("s: s.id);

C.SIMPLECLASS C = C.SIMPLECLASS.CREATE (); C.DO ("LYH"); system.console.writeline ("s: s.id); system.console.writeline (" C: " C .Id);

IF (S.Equals (c)) {System.Console.writeline ("YES");}}}}

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

New Post(0)