Why do we need interfaces to achieve event listeners in java? -


i have doubt in java: when people writing event listener implement interface , define particular function in interface achieve particular task. doubt instead of implementing interface can define function appropriate name.

also, how interfaces in achieving event listeners?

because many different classes want listen same event , java not allow multiple inheritance.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -