When I first started learning
Java I also thought that import statements did some kind of magic. But as Joseph pointed out, import statements are merely a convenience so us programmers don't have to type out long package names repeatedly. They are purely a compile-time convenience. The compiler will use them when it creates the class file (Open a class file in a text editor and you'll see that the complier just prepends the package names on all of your variables for you).