Junghyun Cho

Greenhorn
+ Follow
since May 22, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Junghyun Cho

I found there was Runnable.class in my classpath directory.
After deleting that file, it works.

Thank you , Ernest and all who replied.
15 years ago
It seems it's my computer problem. I tried on other PC and it works.

I don't know why but only calling java.lang.Thread costructor make compiling error happen.
Anyone knowing about this?
15 years ago
Hi,

Would you give me some adivce to solve this compiling error?
Thread class has a constructor which has argument Runnable class.
I can't understand why this happen.

=================================================================
RunnableTest.java:21: cannot find symbol
symbol : constructor Thread(RunnableTest)
location: class java.lang.Thread
new Thread(thread50).start();
^
RunnableTest.java:22: cannot find symbol
symbol : constructor Thread(RunnableTest)
location: class java.lang.Thread
new Thread(thread100).start();
^
2 errors
======================================================
/* RunnableTest.java */
import java.io.*;
class RunnableTest implements Runnable {
long delay;
String message;
RunnableTest(String message, long delay) {
this.message = message;
this.delay = delay;
}
public void run() {
try {
while(true) {
System.out.print(message+ " ");
Thread.sleep(delay);
}
} catch(InterruptedException e){ return; }
}
public static void main(String[] args) {
RunnableTest thread50 = new RunnableTest("t50", 50);
RunnableTest thread100 = new RunnableTest("t100", 100);
new Thread(thread50).start();
new Thread(thread100).start();
}
}
15 years ago