GameV1 游戏;
public void connect() {
connect("//localhost/Game");
if (getServer() != null) {
game= (GameV1) getServer();
}
}
这个方法“connect(”//localhost/Game”);”只需将服务器设置为 upperclase,然后将其转换为 GameV1 游戏=界面 GameV1=带有实现 Game 的具体类
if (getServer() != null) 这返回 true 但我在转换时收到此错误 com.sun.proxy.$Proxy1 无法转换为 GameV1
最佳答案
使用 RMI 远程对象,您无法转换为具体类。您必须转换到远程接口(interface)。
关于java - com.sun.proxy.$Proxy1 无法转换为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20303571/