posted 24 years ago
With regard to point (b):
I believe the sense of "inside" intended by the question refers to lexical scope, so it asks whether you can write
"... new Button() { blah blah };"
anywhere that is not within the outer {} of a method declaration.
And Dilip was on the right track before he got convinced to give up. I think the answer to the question is: False. You can write the above in a constructor as well (which is not technically a method) and in a static initializer too (which is not a method at all).
yiqingye got off on another idea entirely, I think because he understood "inside" in terms of the structural organization of the runtime data. But I don't understand what he meant well enough to say whether I think it's right.
jim goodwin