小编Sag*_*nda的帖子

Java编译优化和性能

 public static void main(String[] args) {
     double [] boxes;
        boxes = new double[]  {20, 10, 5, 40, 20, 41, 41, 2, 6, 7, 3, 4, 5, 6, 23, 34, 7, 8, 2, 2};
        double heaviest = 0;
        double normal = 0;
        double heavy = 0;
        double totalCost;
        double a = 0;
        double b = 0;
        int repeatCount=0;

        for (int i = 1; i < boxes.length; i++) {
            if (boxes[i] > heaviest)
                heaviest = boxes[i];
        }

        for(double element: boxes) {
            if(element==heaviest) …
Run Code Online (Sandbox Code Playgroud)

java arrays compiler-optimization

2
推荐指数
1
解决办法
80
查看次数

标签 统计

arrays ×1

compiler-optimization ×1

java ×1