在UML的类图里,这个一头带个十字圆圈(注意,不是带叉的圆圈)与连线组成的形式,表示内嵌。在实际编程代码中表示嵌在内部的类,通常用来表示突然在内部需要一个匿名类(如new Thread()或者new Runnable()的情况)。
英文介绍如下(摘自
http://www.holub.com/goodies/uml/):
Nesting, Inner Class.. Identifies nesting (containment) relationships in all diagrams. In a class diagram: an "inner" class whose definition is nested within the "outer" class definition. Typically puts the inner class in the name space of the outer class, but may have additional properties.
下面举个例子:
public class SimpleClass { |