0
爲什麼我收到"The return type is incompatible with Map.Entry<SEND,CANDataSendInfo>.getKey()"
不兼容的映射條目與枚舉在Java
在這裏,我想使對象,包括枚舉的關鍵和類對象的價值,而是我在線路越來越問題public SEND getKey()
package cantestbus;
import java.util.Map;
public class SendKV<SEND , CANDataSendInfo> implements Map.Entry<SEND , CANDataSendInfo>
{
enum SEND
{
SEND_0x41, SEND_0x42, SEND_0x43, SEND_0x44, SEND_0x61, SEND_0x62, SEND_0x63, SEND_0x64
}
private SEND key;
private CANDataSendInfo value;
public SendKV(SEND key, CANDataSendInfo value)
{
this.key = key;
this.value = value;
}
public SEND setKey(SEND key)
{
return this.key = key;
}
public SEND getKey()
{
return this.key;
}
public CANDataSendInfo setValue(CANDataSendInfo value)
{
return this.value = value;
}
public CANDataSendInfo getValue()
{
return this.value;
}
}
我真的是你的粉絲@Jon,我從來沒有想過你會對這個查詢感興趣。非常感謝。而且我明白你的觀點。它正在工作。 –