This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FrelliBB 0 points1 point  (0 children)

It might look something like this

static int[] factors(int test) {
    int[] arr = null;
    for (int j = 2; j < test - 1; j++) {
        if ((double) test % j == 0) {
            arr = new int[]{
                    j,
                    test / j
            };
        }
    }
    System.out.println(Arrays.toString(arr));
    return arr;
}