the code execute perfectly well. look where yuo are declaring the class: it is like a common parameter inside a method calls. you would never write something like
you are overriding the already existing class Face (please use the capital letter for classes!) not declaring a brand new class; to test this yuo can delete the Face class declaration (not the inner anonymous class) and see a compilation error.
Just last not do not misunderstand anonymous inner classes with inner classes: in this case you need the ";"
because you are closing the line declaration.
posted 11 years ago
got it. syntax for Argument-Defined Anonymous inner class to end is }); Thanks . please use the capital letter for classes! by the way this question is straight from Mock exam