摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Banking{ class Program { static void Main(string[] args) { string Continue="";//用来保存是否还需要交易标志 Account account1 = new Account(); account1.Balance = 1000;//初始化账户余额 Start: Console.Clear();//清屏 Console. 阅读全文
posted @ 2013-04-16 18:29 Predator 阅读(186) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections;using System.Threading;// "Singleton"class LoadBalancer{ // Fields private static LoadBalancer balancer; private ArrayList servers = new ArrayList(); private Random random = new Random(); // Constructors (protected) protected LoadBalancer() { // List o 阅读全文
posted @ 2013-04-16 18:28 Predator 阅读(137) 评论(0) 推荐(0) 编辑
摘要: staticvoidMain(string[]args){stringContinue="";//用来保存是否还需要交易标志List<Account>listAccounts=newList<Account>{newAccount(101),newAccount(102),newAccount(99),newAccount(250),newAccount(200)};foreach(AccountiteminlistAccounts){Console.WriteLine(item.Balance);}Console.WriteLine("* 阅读全文
posted @ 2013-04-16 18:27 Predator 阅读(168) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text; namespaceSingleton{classProgram{staticvoidMain(string[]args){ //以下代码在没有重写Equals的情况下//Codonp1=newCodon("dd",23);//Codonp2=newCodon("dd",23);//if(p1.Equals(p2))//{//Console.Write("Equal"); //}/ 阅读全文
posted @ 2013-04-16 13:28 Predator 阅读(349) 评论(0) 推荐(0) 编辑