Apart from the issues pointed at by the other posters, I’d rewrite the method to avoid duplicating the information (keep it DRY!):
public static AreaCode area(int n) {
for (AreaCode c : values()) {
if (c.ac == n) {
return c;
}
}
// either throw the IAE or return null, your choice.
throw new IllegalArgumentException(String.valueOf(n));
}