这是我的compareTo方法,但我仍然得到"缺少返回语句"警告.谁能告诉我我的代码有什么问题?
public int compareTo(Flows other) {
if(this.srcAddr.equals(other.srcAddr)){
if(this.dstAddr.equals(other.dstAddr)){
if(this.srcPort.equals(other.srcPort)){
if(this.dstPort.equals(other.dstPort)){
if(this.protocol.equals(other.protocol)){
return 0;
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud) java ×1