The import statement tells the compiler where to look for the external classes you use in your code . It needs to find them to check that you are using them correctly, calling methods that exist, passing the right arguments to them, etc. If you import java.io.