文件名称:Java编程测试源代码
-
所属分类:
- 标签属性:
- 上传时间:2012-10-31
-
文件大小:875byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
一个简单的例子,在它里面用到一个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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.