test.java

来自「这个是关于设计模式的一些小例子」· Java 代码 · 共 18 行

JAVA
18
字号
package test3;

public class Test {

	public static void main(String[] args) {
		//if this class can only use SquarePeg
		
		SquarePeg a = new SquarePeg();
		
		a.insert("SquarePeg ok");
		
		
		SquarePeg b = PegAdapter.create();
		
		b.insert("adapter ok");
	}
}

⌨️ 快捷键说明

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