aspose file tools
The moose likes Threads and Synchronization and the fly likes Puzzle on start() method. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Puzzle on start() method." Watch "Puzzle on start() method." New topic
Author

Puzzle on start() method.

Pratap Reddy
Ranch Hand

Joined: Jan 05, 2001
Posts: 36
I created a class X which implements runnable interface then created a object class ObjX then ObjX.start(). My question is I was expecting compiler error but it did run successfully. Since runnable interface has only one method run() and in my class X
I did not declared start() method...so from where did it pulled from.
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
Did your object extended Thread ? If it did then that's your answer.


Val SCJP <BR>going for SCJD
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1831
Pratap,
Could you please post your code so that people can tell you what is wrong with your code.

------------------
Regds.
Mahindrakar
kiran babu
Greenhorn

Joined: Feb 21, 2001
Posts: 5
hello friend,
there are two ways you can make a class as thread ie you extend Thread class and the second one is by implmenting the interface Runnable so you have done the second one and no need of using the start() menthod and you should not even get compile time error.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Puzzle on start() method.
 
Similar Threads
Java Basics
Difference between run and start method of Thread
Help me Thread
Methods for threads?
Mock Blues 1