Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Recompile with -deprecation for details??

843810Jun 2 2003 — edited Jun 3 2003
Note: C:\Documents and Settings\user\Desktop\annie-chatsapp\other academic research\chat\ChatClient.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
Exit code: 0
No Errors

Hi, may i know what does the above error message means and how am i suppose to solve it?
Below are the codes:

import java.net.*;
import java.io.*;
import java.util.*;

public class ChatHandler extends Thread {

protected Socket s;
protected DataInputStream i;
protected DataOutputStream o;

public ChatHandler (Socket s) throws IOException {
this.s = s;
i = new DataInputStream (new BufferedInputStream (s.getInputStream ()));
o = new DataOutputStream (new BufferedOutputStream (s.getOutputStream ()));
}

protected static Vector handlers = new Vector ();

public void run () {
try {
handlers.addElement (this);
while (true) {
String msg = i.readUTF ();
broadcast (msg);
}
} catch (IOException ex) {
ex.printStackTrace ();
} finally {
handlers.removeElement (this);
try {
s.close ();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}


protected static void broadcast (String message) {
synchronized (handlers) {
Enumeration e = handlers.elements ();
while (e.hasMoreElements ()) {
ChatHandler c = (ChatHandler) e.nextElement ();
try {
synchronized (c.o) {
c.o.writeUTF (message);
}
c.o.flush ();
} catch (IOException ex) {
c.stop ();
}
}
}
}

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 1 2003
Added on Jun 2 2003
2 comments
11,794 views