private Pacman pacman;
public Location whereIsGhost(){
return pacman.getLocation();
}
不兼容的类型:java.awt.Point无法转换为ch.aplu.jgamegrid.Location
如何解决?哪种类型与java.awt.Point兼容?
最佳答案
我相信你有三个选择
Pacmage
getLocation
以返回ch.aplu.jgamegrid.Location
或whereIsGhost
以返回java.awt.Point
或Location
以扩展Point
。 至于哪些类型与
java.awt.Point
兼容,Javadoc没有列出任何已知的子类。
关于java - 为什么我有不兼容的类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27177388/