I am try to form a multi thread in my program but its giving this error
"\Java1.java:87: cannot find symbol
symbol : class mythread2
location: class Multithreading
Thread mythread1; mythread2
^
\Java.java:88: mythread1 is already defined in Multithreading(java.lang.String)
mythread1 = new Thread(this);
^
\Java.java:89: cannot find symbol
symbol : variable mythread2
location: class Multithreading
mythread2 = new Thread(this);
^
\java.java:90: cannot find symbol
symbol : variable mythread2
location: class Multithreading
mythread2.start();"
this is the lines of code that is giving the error
class Animation implements Runnable {
Thread mythread1; mythread2
Animation (String name) {
mythread1 = new Thread( this );
mythread2 = new Thread( this );
mythread1.start();
mythread2.start();
}
...
Can anyone please tell me if it is possible to form a multi thread with
(this)
statment because I think thats where I am going wrong and if it possible how do I do it. Thanks