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.
A class can't contain two methods with the same signature. The signature of a method is its name followed by its arguments.
You may thus have run(int)
and run(String)
and run()
in the same class. This is called method overloading. You can't have two run()
methods, because you (and the compiler) could not know which one to execute when calling obj.run()
.