/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    private static String pattern = ".*[04-9].*";

    public static void main (String[] args) throws java.lang.Exception {
        test("ABC0123", false);
        test("XYZ002456789", false);
        test("ABC123", true);
        test("ABC1", true);
    }

    private static void test(String str, boolean expect) {
        boolean result = !str.matches(pattern); // ! because that's your *dis*allow
        System.out.println(str + " => " + result + (result == expect ? " OK" : " *ERROR*"));
    }
}
