Hm, well if the code is intended is make your eyes bang together, I suppose it's accomplished that. What it does that is useful is another debate.
class B is an inner class, defined within the definition of class A. It has a method called method2 that has zero or more null statements in it.
In the main(), class A is contructed and its implicit result is used as a reference to construct inner class B. The open brace following 'new B()' introduces an anonymous inner class, which is a way to extend B without giving the subclass a name. In this anonymous inner class, method2() is overridden by adding zero or more null statements to its parent form.
That's it; once the anonymous inner class is written, main() exits shortly thereafter.
------------------
Michael Ernest, co-author of:
The Complete Java 2 Certification Study Guide