I have this thread class:
class tCallTime implements Runnable {
private Thread t;
private String threadName;
public tCallTime(String name) {
threadName = name;
println("Creating " + threadName );
}
tCallTime() {
}
void codeToRun() {
//Override This
callTime();
}
public void run() {
println("Running " + threadName );
try {
codeToRun();
Thread.sleep(0);
}
catch (InterruptedException e) {
println("Thread " + threadName + " interrupted.");
}
}
public void start () {
if (t == null) {
t = new Thread (this, threadName);
t.setPriority(10);
println("Started " + threadName + " with priority " + t.getPriority());
t.start ();
}
I tried to inherit from this by doing this:
class tCalcVertex extends tCallTime{
@Override
void codeToRun(){
print("test");
}
}
I then try to run it by using the following code:
tCallTime thread = new tCallTime("Thread-1");
thread.start();
tCalcVertex thread2 = new tCalcVertex("Tread-2");
thread2.start();
The compiler then tells me that "The constructor "tCalcVertex(String)" does not exist" How would i go about inheriting from this class without having to rewrite the whole class