自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(3)
  • 资源 (4)
  • 收藏
  • 关注

转载 java的队列

java中queue的使用 Queue接口与List、Set同一级别,都是继承了Collection接口。LinkedList实现了Queue接 口。Queue接口窄化了对LinkedList的方法的访问权限(即在方法中的参数类型如果是Queue时,就完全只能访问Queue接口所定义的方法 了,而不能直接访问 LinkedList的非Queue的方法),以使得只有恰当的方法才可以使用。B

2015-08-19 08:28:28 279

转载 闭包,懂不懂由你,反正我是懂了

闭包,懂不懂由你,反正我是懂了 越来越觉得国内没有教书育人的氛围,为了弄懂JS的闭包,我使出了我英语四级吃奶的劲去google上搜寻着有关闭包的解释,当我看到stackoverflow上这一篇解答,我脑中就出现了一句话:就是这货没跑了! 不才译文见下,见笑了。 Peter Mortensen问: 就像老Albert所说的,“如果你不能向一个六岁的孩子解释

2015-07-09 10:14:17 374

转载 同步与异步的区别

进程同步用来实现程序并发执行时候的可再现性。 一.进程同步及异步的概念 1.进程同步:就是在发出一个功能调用时,在没有得到结果之前,该调用就不返回。也就是必须一件一件事做,等前一件做完了才能做下一件事.就像早上起床后,先洗涮,然后才能吃饭,不能在洗涮没有完成时,就开始吃饭.按照这个定义,其实绝大多数函数都是同步调用(例如sin,isdigit等)。但是一般而言,我们在说同步、异步的时候,特指那

2015-07-08 15:37:08 397

校友录网站系统

学校管理,专业管理,班级管理,班级共享,评论管理

2015-08-12

pl sql 官方英文文档

这是关于pl/sql 开发文档,有需要的朋友可以下载看看。谢谢。

2015-07-03

ASP.NET电脑信息系统代码

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace information_of_computers { [Serializable] public class Computer { public Computer() { } public Computer(string name, string brand, string cpu, string memory, string hardDisk, string monitor) { this.Name = name; this.Brand = brand; this.CPU = cpu; this.Memory = memory; this.HardDisk = hardDisk; this.Monitor = monitor; } private string name; public string Name { get { return name; } set { name = value; } } private string brand; public string Brand { get { return brand; } set { brand = value; } } private string cpu; public string CPU { get { return cpu; } set { cpu = value; } } private string memory; public string Memory { get { return memory; } set { memory = value; } } private string hardDisk; public string HardDisk { get { return hardDisk; } set { hardDisk = value; } } private string monitor; public string Monitor { get { return monitor; } set { monitor = value; } } } }

2013-05-29

asp.net程序ATM

这是ASP.NET的文档using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ATM { class Bank { private List<Account> accounts; public List<Account> Accounts { get { return accounts; } set { accounts = value; } } private int currentAccountNumber; public int CurrentAccountNumber { get { return currentAccountNumber; } set { currentAccountNumber = value; } } public Bank() { accounts = new List<Account>(); } public Account OpenAccount(string password, string confirmationPassword, string name, string personId, string email, int typeOfAccount) { Account newAccount; if (!password.Equals(confirmationPassword)) { throw new InvalidOperationException("两次密码输入的不一致!"); } switch (typeOfAccount) { case 1: newAccount = new SavingAccount(password, name, personId, email); break; case 2: newAccount = new CreditAccount(password, name, personId, email); break; default:throw new ArgumentOutOfRangeException("账户类型是1到2之间的整数"); } accounts.Add(newAccount); return newAccount; } private Account GetAccountByID(long id) { foreach (Account account in accounts) { if(account.ID==id) { return account; } } return null; } public Account SignIn(long id, string password) { foreach (Account account in accounts) { if (account.ID == id && account.Password.Equals(password)) { return account; } } throw new InvalidOperationException("用户名或者密码不正确,请重试!"); } public Account Deposit(long id, double sum) { Account account = GetAccountByID(id); if (account != null) { account.Deposit(sum); return account; } throw new InvalidOperationException("非法账号!"); } public Account Withdraw(long id, double sum) { Account account = GetAccountByID(id); if (account != null) { account.Withdraw(sum); return account; } throw new InvalidOperationException("非法账号!"); } public Account SetCeiling(long id, double newCeiling) { Account account = GetAccountByID(id); try { (account as CreditAccount).Ceiling = newCeiling; return account; } catch (Exception ex) { throw new InvalidOperationException("此账户不是信用账户!"); } throw new InvalidOperationException("非法账号!"); } public double GetTotalBalance() { double totalBalance = 0; foreach (Account account in accounts) { totalBalance += account.Balance; } return totalBalance; } public double GetTotalCeiling() { double totalCeiling = 0; foreach (Account account in accounts) { if (account is CreditAccount) { totalCeiling += (account as CreditAccount).Ceiling; } } return totalCeiling; } } }

2013-05-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除