There are two truly anonymous classes in Java. First, this is an unnamed inner class. For instance:
class BGThread<T>{...} ... class TitleEditDlg{ new BGThread<Props>(cont, true) { @Override public Props run() { ... } } }
Quote from the UML 2.5 standard (p.149):
Standard notation for an anonymous instance. Specification unnamed Classifier - underlined colon (':).
So, as for the anonymous java class, you have to create a class block with the name :
as a name and connect the container class to it twice - relative to the container and the unidirectional arrow without a dot. On the other hand, a block :
must connect to the parent class.
According to the same source, Anonymous Bound Class
, that is, the second anonymous class that we meet in Java, but often do not notice it when you use a template / common class, as in
class BGThread<T>{...} ... class TitleEditDlg{ BGThread<String> newThread= new BGThread<String>(); }
can be displayed in two ways:
- As a
bind
addiction, with a replacement for it. - As an intermediate class, with the name of the parent class and substitution in angle brackets. Please note: here the class is anonymous, but the attribute has a name. So this way you show more information.
source share