test.java~1~
来自「《深入浅出设计模式》的完整源代码」· JAVA~1~ 代码 · 共 31 行
JAVA~1~
31 行
/** * See page 198 of DESIGN PATTERNS [1995]. * Implemented by Blueprint Technologies, Inc. *//** * Package */package com.blueprint.patterns.gamma.structural.flyweight;/** * Test driver for the pattern. */public class Test{ public static void main( String arg[] ) { try { FlyweightFactory factory = new FlyweightFactory(); Flyweight fly1 = factory.getFlyweight( "Fred" ); Flyweight fly2 = factory.getFlyweight( "Wilma" ); } catch( Exception e ) { e.printStackTrace(); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?