• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sams teach yourself java help

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im in hour 19 of sams java book and we are talking about threaded programs. I have copied over his programs or even copy and pasted them and there is just something run with the threaded part of them.

indPrimes.java:36: error: constructor Thread in class Thread cannot be applied to given types;
go = new Thread(this);
^
required: no arguments
found: FindPrimes
reason: actual and formal argument lists differ in length
./Thread.java:31: error: constructor Thread in class Thread cannot be applied to given types;
t = new Thread( this );
^
required: no arguments
found: Thread
reason: actual and formal argument lists differ in length
./Thread.java:80: error: cannot find symbol
t.sleep( 1000 ); // interval given in milliseconds
^
symbol: method sleep(int)
location: variable t of type Thread
3 errors

Those are the errors I get. Any idea why I am getting these?

Here is the link to the code if your interested in checking it out. Any help is appreciated I really cant figure this out and would like to finish up these last few chapters.Thanks a bunch
http://workbench.cadenhead.org/book/java-7-24-hours/source/chapter19/PrimeFinder.java
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post the code. Be sure to UseCodeTags.
 
Tyler Heez
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Name change sent posted the code in the URL link at the bottom. Its all typed up for the book already. Sorry about tbreaking the "rule" just been frustrated with threads
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Java Newb wrote:
./Thread.java:31: error: constructor Thread in class Thread cannot be applied to given types;



Did you happen to have written your own Thread class?

Henry
 
Tyler Heez
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No i didnt write my own thread class. I only did what the book told me and what is written in the url code above.
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Java Newb wrote:No i didnt write my own thread class. I only did what the book told me and what is written in the url code above.



Can you check again? Do you happen to have a Thread.java (or Thread.class) file in the same directory?

Henry
 
Tyler Heez
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was it thank you very much. I had a file named Thread.java in the same directory. Your the best thank you.
reply
    Bookmark Topic Watch Topic
  • New Topic