If I try to use IOException with no fully qualified name and no import, I get a compilation error. But that doesn't happen when I do the same thing like RuntimeException or Exception. Why is this?
You cannot import classes from a package java.lang.
. It's not just RuntimeException, but things like Object and String.