I keep getting this error message with this code and I don't understand what it's telling me! Do I need to sort of merge the two chatter methods?
.\Chatter.java:96: error: variable name might not have been initialized } ^ 1 error
And that is the whole error. it points towards the } which is closing the final method (public Chatter).
I would really appreciate if someone could help me with this, I also get the feeling that I will need to change a method in another class which uses this one once this problem has been resolved..
The Code
public class Chatter implements Runnable { /** * The name of the Chatter. * This should be the ID chosen by the remote user on joining * the chatroom. * This value is set in the constructor. * */ public final String name; public void run() { } /** * Creates a new <code>Chatter</code> instance with a given name. * This constructor implements operation newChatter in the * <a href="chatroom.maude">Chatter specification</a>. * * @param n the name for this Chatter */ public Chatter(String n) { name = n; } /** * Return the {@link #name name} of the Chatter. * This method implements operation getName in the * <a href="chatroom.maude">Chatter specification</a>. * * @return the {@link #name name} of the Chatter */ public String getName() { return name; } /** * Send a message across the network to the remote user. * * @param msg the msg to be sent */ public void sendToUser(String msg) { } Chatter theChatter; /** * Pointer to the tail of the list. * Default scope modifier, so that this field can be efficiently * accessed in class ChatterList. * */ Chatter next; /** * Creates a new <code>ChatterNode</code> instance. * * @param c the Chatter at this node * @param next the tail of this list */ public Chatter(Chatter c, Chatter next) { this.next = next; theChatter = c; } }