factoryp1.java

来自「用实例描述了factory设计模式。 并且该实例都已编译通过」· Java 代码 · 共 30 行

JAVA
30
字号
/*
 * Created on 2006-11-13
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

package cn.edu.hunnu.factory.impl;

import cn.edu.hunnu.factory.Factory;
import cn.edu.hunnu.product.Product;
import cn.edu.hunnu.product.impl.Product1;

/**
 * @author spring
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class FactoryP1 extends Factory {

	String name = "P1Factory";

	public Product create() {
		Product temp = new Product1();
		return temp;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?