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 ";"