Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Resizes an array of ints to a specified size.
     *
     * @param list Array to be resized.
     * @param newSize Array size after resizing
     * @return Array of ints with the specified size
     */
    static public int[] resizeArrayInt(int[] val, int newSize) {
        int[] newval = new int[newSize];
        System.arraycopy(val, 0, newval, 0, Math.min(val.length, newSize));
        return newval;
    }

    public static float min(float[] f) {
        float min = Float.MAX_VALUE;
        for (float ff : f)
            if (ff < min)
                min = ff;
        return min;
    }
}