Answers to Tuesday Quiz part II

Re: Answers to Tuesday Quiz part II

by Akash Surti -
Number of replies: 0

We have used anonymous inner classes in our labs. What role do they play?

The anonymous inner class has access to the final outer variables, this makes the code easier to follow. They help remember that everything within the outermost set of parentheses is passed through the inner class. Basically used for stylistic preference.


Reference:

http://stackoverflow.com/questions/19265626/why-should-i-use-anonymous-classes-in-android-instead-of-class-redefinition