aspose file tools*
The moose likes Beginning Java and the fly likes Help with this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with this "ready-bake code", implementing Runnable" Watch "Help with this "ready-bake code", implementing Runnable" New topic
Author

Help with this "ready-bake code", implementing Runnable

Tarek Khojah
Ranch Hand

Joined: Jul 21, 2007
Posts: 58


The "ClientHandler" class implements Runnable, but when I create the thread (Thread t = new Thread(new ClientHandler(clientSocket)) I get an error saying there is no such constructor for ClientHandler, I looked into the API and it had nothing on Runnable's constructor(s).

Help please.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
public class ClientHandler

public void clientHandler (Socket clientSocket)

Capitalization matters in Java. The second line of code is currently not a constructor for the class.


Ping & DNS - my free Android networking tools app
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3646
    
  15
And if you do want it to be a constructor, you will need to get rid of the 'void', otherwise it will just be a method with the same name as the class.


Joanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with this "ready-bake code", implementing Runnable