Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Really novice... Cannot resolve symbol  RSS feed

 
Emili Calonge
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting this error when comipling a symple tutorial code and I'd like to get some help of you...
The error is this:

applets/declaracio.java [17:1] cannot resolve symbol
symbol : constructor Thread (applets.declaracio,java.lang.String)
location: class java.lang.Thread
animationthread = new Thread(this,"animationthread");
^
1 error
Errors compiling declaracio.

If you want I can post the code but as I said it only starts a thread and displays a text on the browser, really simple but giving me a big headache.
Thanks in advanced.
PD: I'm new to this forums so Hello to all!
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Emili,
Assuming the error message is unclear to you, it is saying that there is no constructor in class "java.lang.Thread" that takes two parameters where the first one is an instance of "applets.delcarcio" and the second one is an instance of "java.lang.String".
Looking at the javadocs for "java.lang.Thread", there is a constructor that takes two parameters where the first is an instance of "java.lang.Runnable" and the second one is an instance of "java.lang.String".
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Thread.html
I think this is the one you meant to use. If that is the case then your "applets.delcarcio" class needs to implement the "Runnable" interface, example:

Hope this helps.
Good Luck,
Avi.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!