先看三种工厂模式部分主要代码(完整代码在前三篇博客):
简单工厂模式:
public class SampleFactory
{
public static Animal createAnimal(String animalName){
if("Tiger".equals(animalName))){
return new Triger();
}else if(...
分类:
其他好文 时间:
2014-07-26 02:04:26
阅读次数:
165
本文内容来自书上,不懂设计模式,只求混个眼熟。
三、抽象工厂模式
1. 动物管理系统的例子
public interface Animal{
public void eat();
}
public class Tiger implements Animal
{
public void eat(){
sysout.out.println("老虎会吃");
};
p...
分类:
其他好文 时间:
2014-07-25 11:15:01
阅读次数:
196
1、系统kernel参数设置 cat >> /etc/sysctl.conf << "EOF"
##### for Oracle_11gR2 #####
fs.aio-max-nr = 1048576
fs.file-max = 6815744
# kernel.shmall=2097152
# kernel.shmmax=4195057664
kernel....
分类:
数据库 时间:
2014-07-25 00:10:44
阅读次数:
541
1、官方下载安装包:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.htmllinuxamd64_12102_database_1of2.ziplinuxamd64_12102_database_1of2.zip2、创建oracle用户和组[root@localhost]#groupaddoinstall[root@localhost]#groupadddba[root@..
分类:
数据库 时间:
2014-07-24 23:48:44
阅读次数:
395
#Red hat enterprise linux variants ##Two install sets available ##两种安装方案 ###Server rhel server rhea advanced platform ###Desktop rhel desktop workstation option Multi-OS option ##RH network #...
分类:
Web程序 时间:
2014-07-23 21:33:26
阅读次数:
283
在linux oracle 10g/11g x64bit环境中,goldengate随os启动而自动启动的脚本...
分类:
数据库 时间:
2014-07-23 13:34:26
阅读次数:
284
rhel 6.4 增加光盘为yum repo版本LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4....
分类:
其他好文 时间:
2014-07-23 12:39:16
阅读次数:
224
之前Google就说了,由于CentOS/RHEL 6已经是过期的系统,所以不再会有Chrome了。 虽然后来由于引起了社区的抗议,从而改口,不再提CentOS/RHEL 6是过期系统了;但是,目前在CentOS/RHEL 6上已经没有Chrome可以下载使用了。其实,根本的原因不是CentOS/R...
分类:
其他好文 时间:
2014-07-22 22:40:34
阅读次数:
345
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815
题意:很“内涵”的一个题面,题意是给出N道题,和一个概率P,然后给出每道题对应的得分aa[i](每道题只有两个选项,一个正确一个错误)。两个人来答题,一个人是随机选择答案,问另一个人至少要答多少分才能保证有P的概率不会失败。
思路:是一道DP题,最开始想强行枚举所有情况,找到需要分数,后来发现4...
分类:
其他好文 时间:
2014-07-22 14:26:12
阅读次数:
227
二、工厂方法模式
1.动物管理系统的例子
首先,抽象的动物类和具体的动物实现类:
public interface Animal{
public void eat();
}
public class Tiger implements Animal
{
public void eat(){
sysout.out.println("老虎会吃");
};
...
分类:
其他好文 时间:
2014-07-22 00:07:33
阅读次数:
231