Labels

Monday, June 11, 2012

What is an anonymous class in java?

It is a type of inner class with no name. Once defined an object can be created of that type as a parameter all in one line. it cannot have explicitly declared constructor. The compiler automatically provides an anonymous constructor for such class.An anonymous class is never abstract. An anonymous class is always an inner class; it is never static. An anonymous class is always implicitly final.

No comments:

Post a Comment