Example for interface in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Example for interface in java

26th Feb 2018, 4:45 AM
vasu
vasu - avatar
4 Answers
26th Feb 2018, 5:02 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
26th Feb 2018, 5:06 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 1
real world example
26th Feb 2018, 5:03 AM
vasu
vasu - avatar
0
Runnable If you want to make a Thread (for doing things simultaneously), you just inherit from the Interface so the JVM knows:"Okay my small class, you want t be a thread? Let's do it! I know you are able to do it, because you are just like a real Thread because of that interface and so you habe the run()-Method, for example! Excellent!" Any more questions? ;-)
26th Feb 2018, 6:24 AM
D B
D B - avatar