作者PsMonkey (痞子军团团长)
看板java
标题Re: [问题] 想请问一下这一段程式码错在哪里?
时间Sat Apr 17 17:25:00 2010
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