Re: [問題] 想請問一下這一段程式碼錯在哪裡?
try this:
public String emptyError(){}
the same error message \囧/
and then try this:
public String branchError(){
if(true){
return "\\囧/";
}
}
hmmm... like my situation and... the same error message \囧/
how about this:
public String branchOK(){
if(true){
return "\\囧/";
}else{
return "Orz";
}
}
or
public String branchOK2(){
if(true){
return "\\囧/";
}
return "Orz";
}
what happen?
why... why so routine...? <囧>
is any advantage heeeeeeerrrrrrrrrreeeeeee.........
※ 引述《thnestar (峰)》之銘言:
: 44 public String toString()
: 45 {
: 46 if(imaginary==0)
: 47 return (real+"");
: 48
: 49 else if(imaginary<0)
: 50 return (real+"-"+(imaginary*(-1))+"i");
: 51
: 52 else if(imaginary>0)
: 53 return (real+"+"+imaginary+"i");
: 54 }
: 我在compile的時候會顯示
: C:\Users\acer\Desktop\5_7\ComplexNumber.java:54: missing return statement
: }
: ^
: 1 error
: 但是我如果把這一段給刪除,compile就會成功,
: 所以我想問題應該是出在這一段。
: 不過我不曉得到底哪裡有出錯呢?
: 看不太出來的說...
雖然說有版主帶頭灌水之嫌
不過我最近真是個好人啊...... [扭扭]
--
錢鍾書: 說出來的話
http://www.psmonkey.org
比不上不說出來的話
Java 版 cookcomic 版
只影射著說不出來的話
and more......
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.70.199.248
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):