|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
test(num);怎么理解??
- package lianxi1;
- public class math1 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- double[] nums = { 1.4, 1.5, 1.6, -1.4, -1.5, -1.6 };
- for (double num : nums) {
- test(num);
-
-
- }
- }
-
- private static void test(double num) {
- System.out.println("Math.floor(" + num + ")=" + Math.floor(num));
- System.out.println("Math.round(" + num + ")=" + Math.round(num));
- System.out.println("Math.ceil(" + num + ")=" + Math.ceil(num));
- }
- }
复制代码 |
|