Java Thread Implementation
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Is it possible to create a thread without extending Thread class or implementing Runnable interface nor using anonymous inner class ??
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Prerana Verma wrote:
Is it possible to create a thread without extending Thread class or implementing Runnable interface nor using anonymous inner class ??
![]()
![]()
![]()
Can you give us the reason for such a request? Seems like a arbitrary restriction to me.
Regardless, I guess one option would be to use one of the services returned by java.util.concurrent.Executors -- but of course, under the hood, those service classes will create threads using the Thread class.
Henry
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
It’s just a java beginner’s query. I was trying to implement that but didn’t find any way (Found one by using anonymous class).
Just wanted to know if there is any other way of doing this.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Prerana Verma wrote:Thanku for replying...
![]()
It’s just a java beginner’s query. I was trying to implement that but didn’t find any way (Found one by using anonymous class).
Just wanted to know if there is any other way of doing this.
How does an anonymous class allow you to do that?
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Even as a "java beginner's query" it makes no sense to me. Thread and Runnable are there for the sole purpose of making it easy for you to create concurrent functionality in your application and there is no need to do it any other way.
Let's say you did find some crazy obscure way to do it. If you ever implemented it in a team development environment you would become very unpopular very quickly. Maintenance of that code would be near impossible.
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
@Tim Cooke: I'm agree with you. and I'm also not going for that complex code.
but here my question was.. "Is it possible to create...."
n was expecting a answer either Yes or No, n just a justification for that..
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Prerana Verma wrote:Thanku for replying...
Prerana Verma wrote:but here my question was.. "Is it possible to create...."
n was expecting a answer either Yes or No, n just a justification for that..
As a side note, please UseRealWords while posting.
By the way, you still haven't answered Henry's question.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ulf Dittmer wrote:Sometimes the best answer to a question is Mu
Learned (learnt) something new and useful

Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Prerana Verma wrote:@Saifuddin Merchant : By Creating anonymous class for Runnable or Thread.
At the end of the day your still using Runnable or Thread.
So an answer to your question "Is it possible to create...." is No. Whatever you do you will be either extending Thread or implementing Runnable either directly or indirectly.
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Heena Agarwal wrote:
As a side note, please UseRealWords while posting.
By the way, you still haven't answered Henry's question.
Thank you, I'll keep that in my mind....next time..
By the Way......Reread my post!
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Saifuddin Merchant wrote:
Prerana Verma wrote:@Saifuddin Merchant : By Creating anonymous class for Runnable or Thread.
At the end of the day your still using Runnable or Thread.
So an answer to your question "Is it possible to create...." is No. Whatever you do you will be either extending Thread or implementing Runnable either directly or indirectly.
Thankyou..
| Why is the word "abbreviation" so long? And this ad is so short? The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |









