This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help with this Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 35438
    
    9
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.


Android appsImageJ pluginsJava web charts
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
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
 
Similar Threads
85 line program...wondering if it's possible to do in Applets
Annotation for VerySimpleChatServer from Head First Java book
What type should i cast?
Client disconnected from server after about 10 minutes of inactivity
ServerSocket to SSL