• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Multi thread question in interview

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How Thread can be implemeted in code... All i know is it can be done in 2 ways either by implementing "Runnable" interface or by extending "Thread" class.
Is there any other way?? else how to answer for this question?
 
lowercase baba
Posts: 12749
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is an interview question, then they are probably less interested in you giving the "right" answer than in how you answer.

And in my opinion, there is nothing wrong with saying "I am not sure" to any technical question like that.
 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i'm interested in knowing the answer.
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JRE has many more ways to create threads than those two, although fundamentally they probably all boil down to using a Thread object. I don't know that it matters how many ways there are, although the more you can name, probably the better. If you can name only the two you mentioned, then that may indicate that either your Java knowledge is stuck in the pre-Java 5 mindset (Java 5 introduced the java.util.concurrent package, which greatly expanded Java's concurrency capabilities), or that you never implemented concurrency-heavy code.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!