If so, how? I need to have 2 run methods in each object I will instantiate.
I meant a run method for threading.
What i need is more like a race of two cars.
As you asked, you want to know if it's possible to have more than one run() method in a class that implements the Runnable interface, or extends the Thread class.
You can just think about the definition of a thread. A thread is a single instructions block, contained inside a process, that's why a thread is called as a lightweight process. Generally, a thread executes only a specific task.
A new thread is created when the main process of a program needs to do multiple operations in background, such as autosaving or grammar check, if the main program is a word processor, for example. This is the concept of multithreading.
Now, if you read the Runnable or Thread API, you can see that the class that extends Thread class or implements the Runnable class, overrides (in case you are extending Thread class) the run() method or implements the abstract method run() (in case you are implementing the Runnable class).
As other users said, you can use the overloading technique. You can implement another run() method in the class, with a different signature, because it's not a legal practice to have multiple methods with the same signature (it generates confusion for the compiler when you have to invoking one of them) and because it's non sense.
But, remember, at the moment of the starting of the thread, using, for example Thread.start(), then the method will invoke always the run() method you defined previously, with the empty signature. It's possible only to invoke another run method, with a different signature as run(String s), in the main run() method of thread.
For example:
public class Thread implements Runnable{
public void run(){
//instructions
Object o = new Object();
run(o);
}
public void run(Object o){
//other instructions
}
}
public class OtherClass{
Thread t = new Thread();
t.start(); //this will invoke the main run() method!
}