| Author |
Anonymous Classes Implementing An Interface Issue
|
Ehsan Rahman
Ranch Hand
Joined: Feb 16, 2009
Posts: 59
|
|
Hi Everyone,
Hope you are having a good day/night. Stumbled upon another anonymouse class issue:
Please could someone explain why assignment to A works but the assignment to B (by not assigning immediately) doesn't work.
Many Thanks,
Ehsan
|
SCJP 1.5, SCJD 1.6
|
 |
Chad Cook
Greenhorn
Joined: Dec 02, 2004
Posts: 29
|
|
|
What error message(s) are you receiving?
|
 |
Ehsan Rahman
Ranch Hand
Joined: Feb 16, 2009
Posts: 59
|
|
When compiling:
The following compiler error message appears:
|
 |
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35257
|
posted

0
|
|
You can't have code (like an assignment) outside of methods, unless they're part of a field declaration, or in a static initializer.
|
Android apps – ImageJ plugins – Java web charts
|
 |
 |
|
|
subject: Anonymous Classes Implementing An Interface Issue
|
|
|