I want to clarify a doubt in multi threading in java. Cant we create an interface with run() and implement it instead of Runnable interface. Will it work?
Asked
Active
Viewed 88 times
-6
-
8Well how would you expect to pass it to the `Thread` constructor? This is pretty easy to try - so I suggest you delete this question, try it (the research you should do before asking a question), then ask a question if you still need any clarification. – Jon Skeet Sep 20 '15 at 08:13
-
1If you mean create your own interface with a `run()` method that isn't called the common `Runnable` in Java, then you can, except pretty much all of the concurrency libraries won't recognize it. Why would you want to do this? – Ownaginatious Sep 20 '15 at 08:14