[英]String[] cannot be converted to int by method invocation conversion?
[英]JSONObject cannot be converted to String by method invocation conversion
(新警报)
我正在使用Java-WebSocket和json-simple 。
解决与问题后put
婷到JSONObject
这个问题使用旧代码不使用泛型时,如何避免Eclipse的警告? ,我现在正在尝试发送sendToAll
obj
但正在
error: method sendToAll in class WebSocketServerBase cannot be applied
to given types;
ws.sendToAll(obj);
^
required: String
found: JSONObject
reason: actual argument JSONObject cannot be converted to String by method
invocation conversion
1 error
如何sendToAll
obj
?
obj
是一个JSONObject
,该方法需要一个String
。 我确定有某种方法可以将您的obj
转换为可识别它的String
,但是我不知道它是什么。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.