其实今天学的东西很多,不过可以记录的不多
1.
A return statementt is required for a nonvoid method. The method shown below is logically correct, but it has a complication error because the Java complier thinks it possible that this method does not return any value.
public static int sign(int n) {
if (n < 0) return 1;
else if (n == 0) return 0;
else if (n > 0) return -1;
}
To fix problem, just delete (n > 0)

posts - 403, comments - 310, trackbacks - 0, articles - 7
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

1.22 Java notes

Posted on 2007-04-22 20:22 ZelluX 阅读(120) 评论(0)  编辑  收藏 所属分类: OOP
2007-01-22 22:00:47
只有注册用户登录后才能发表评论。


网站导航: