DatagramPacket receivePacket = new DatagramPacket(receiveData,
receiveData.length);
_socket.receive(receivePacket);
String sentence = new String(receivePacket.getData());
InetAddress IPAddress = receivePacket.getAddress();
int port = receivePacket.getPort();
if(sentence.equals("hello")) (...)
问题:sentence.equal("hello")
当句子是时,为什么不是真的"hello"
?是因为 String 的 ConstructorString(byte[])
吗?
我能对付谁?
谢谢