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
Post a Comment