This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "thread" Watch "thread" New topic


kamal vashist

Joined: Sep 13, 2006
Posts: 2
How can we create & start thread in one statement by implementing Runnable class .
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Do you know how to create an anonymous inner class?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

Moving to our "Threads and Synchronization" forum.

[Jess in Action][AskingGoodQuestions]
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
try the following

new Thread(new Runnable(){
//your code

Is that what you want

Rahul Bhattacharjee
LinkedIn - Blog
Don't get me started about those stupid light bulbs.
subject: thread
Similar Threads
Thread and Object
Thread & Synchronization
WA #1.....word association
Tech Word Game