读书人

错在哪呢?该怎么处理

发布时间: 2013-07-01 12:33:04 作者: rapoo

错在哪呢?
public class exam4 {
public static void main(String[] args) {
int maxvalue;
maxvalue = max(123, 22, 122);
System.out.println("三个数的最大值是" + maxvalue);
}

public static int max(int x, int y, int z) {
int temp, maxvalue;
temp = (x > y) ? x : y;
maxvalue = (temp > z) ? temp : z;
return maxvalue;
}
}
[解决办法]
没错啊,哪有什么错呢?

读书人网 >J2SE开发

热点推荐