Quantcast
Channel: "implements Runnable" vs "extends Thread" in Java - Stack Overflow
Viewing all articles
Browse latest Browse all 45

Answer by Powerlord for "implements Runnable" vs "extends Thread" in Java

$
0
0

I'm not an expert, but I can think of one reason to implement Runnable instead of extend Thread: Java only supports single inheritance, so you can only extend one class.

Edit: This originally said "Implementing an interface requires less resources." as well, but you need to create a new Thread instance either way, so this was wrong.


Viewing all articles
Browse latest Browse all 45

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>