| Article: |
Making Java Objects Comparable | |
| Subject: | Not anonymous classes :-) | |
| Date: | 2003-03-13 03:01:29 | |
| From: | anonymous2 | |
|
Thanks for the article. Just one pedantic point - in your final example you're using static inner classes not anonymous inner classes. They have names - FirstNameComparator and LastNameComparator!
|
||
Showing messages 1 through 2 of 2.
-
Not anonymous classes :-)
2003-03-14 05:49:40 fabiolourencetti [View]
-
Not anonymous classes :-)
2003-03-18 01:54:56 jczeus [View]
Being even more pedantic:
Following the java naming conventions, these two (static) members should start with a lowercase. Perhaps this is what produced some confusion: these are no classnames!
The proof that these classes are anonymous: compilation of the Person class also produces the two files: Person$1.class and Person$2.class.



FirstNameComparator and LastNameComparator are static attributes. Anonymous class is:
new Comparator() {...}
Fabio
Brazil/Sao Paulo