7

If I try to use IOException without the fully qualified name and without importing, I get a compilation error. But it doesn't happen when I do the same with, say, RuntimeException or Exception. Why is that?

Thanks

Jakub Zaverka
  • 8,816
  • 3
  • 32
  • 48
dumptoday
  • 197
  • 3
  • 6

1 Answers1

12

Classes from package java.lang. need not be imported. It's not just RuntimeException, but also stuff like Object and String.

Jakub Zaverka
  • 8,816
  • 3
  • 32
  • 48