What is an anonymous inner class?

Others 109 views 1 replies

How is it different from an inner class?

Replies (1)

An anonymous inner class is an inner class name declared without a class name.

The difference between the both would be:-

1. An anonymous inner class has no class name whereas an inner class has a class name. 

2. An inner class consists of a class declared within a method whereas an anonymous inner class is declared when an instance is created

I hope that helps!


CCI Pro

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register