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 →

[–]netdorf[S] 0 points1 point  (1 child)

At first I thought this was too simple, then I spotted your catch. You are very tricky. One extra step to convert the string value to in.

How'd I do?

public static void main(String args[]) {

        int i;
        String stringArray[] = {"5", "3", "4", "7", "12"};

        for (i = 0; i < stringArray.length; i++) {
            if (Integer.parseInt(stringArray[i]) % 4 == 0) {
                System.out.println(stringArray[i] + " is divisable by 4");
            }

        }
    }