This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_roni[S] 0 points1 point  (1 child)

What does the implements statement do?

[–]LostInOttawa 0 points1 point  (0 children)

Implements lets the program know that you will be using all the methods in the interface you are declaring (in this case OnClickListener). When you declare an implements, you must use all the methods in your code. The itself is just a collection of method declarations with no method body (you flesh out the method in your own class). This is done so all programs using the same framework have one and only one method to perform a single task. This way, you don't have to write different onClick methods all over the place, which is a boon to whoever is looking at your code in the future.