文件名称:test
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- E*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
一个简单的例子,在它里面用到一个Factory类. 假设规定名字的输入格式可以是:
fisrtname lastname
lastname,firstname
我们需要一个父类Namer,Namer中有字符串类型的成员: frName与lsName,有成员函数getFrname() 和getLsname(),通过继承Namer定义以上两种名字格式的子类:FirstFirst与LastFirst. Factory类提供一个函数,它根据输入的参数判断输入的名字是哪种格式,然后返回相应的类.
-A simple example, in its use inside a Class Factory. The assumption that the provisions of the name of the input format can be: fisrtname lastnamelastname, firstname We need a parent class Namer, Namer in strings types of members: frName with lsName, a member function getFrname () and getLsname (), through the succession of these two kinds of names Namer definition format subclass: FirstFirst with LastFirst. Factory class provides a function, which according to input the names of input parameters to determine which type of format, and then returned to the corresponding category .
fisrtname lastname
lastname,firstname
我们需要一个父类Namer,Namer中有字符串类型的成员: frName与lsName,有成员函数getFrname() 和getLsname(),通过继承Namer定义以上两种名字格式的子类:FirstFirst与LastFirst. Factory类提供一个函数,它根据输入的参数判断输入的名字是哪种格式,然后返回相应的类.
-A simple example, in its use inside a Class Factory. The assumption that the provisions of the name of the input format can be: fisrtname lastnamelastname, firstname We need a parent class Namer, Namer in strings types of members: frName with lsName, a member function getFrname () and getLsname (), through the succession of these two kinds of names Namer definition format subclass: FirstFirst with LastFirst. Factory class provides a function, which according to input the names of input parameters to determine which type of format, and then returned to the corresponding category .
(系统自动生成,下载前可以参看下载内容)
下载文件列表
test.java