Interfaces in java(KeyListener) | Sololearn: Learn to code for FREE!

+2

Interfaces in java(KeyListener)

Hey, I made a research about interfaces and I found that you can declare functions in them without body and their functionality you need to write in class in which you implement this interface! So how the KeyListener does something on click or on release the key etc. How can I create an Interface to be able to call update funcion only after some event?

10/7/2019 10:53:47 AM

Lighton

4 Answers

New Answer

+1

Lighton KeyListener is a interfare itself. Check that link which is shared by us.

0

Maybe this can help. Here given with examples. https://www.javatpoint.com/java-keylistener

0

No I mean this thing: KeyListener has some funcionality! Interfaces cannot have funcionality! How this stuff works? How to create an Interface that will do some operations for example update on some event such as player moved

0

I had exactly the same question for a while. 😆 https://www.sololearn.com/Discuss/1794604/?ref=app I hope this helps you.