O'Reilly logo
  • oik swiss thinks this is interesting:

static imports


Cover of Head First Java, 2nd Edition


Importing a class statically - example: import static java.Math.; By importing this, I don't have to type Math.random() or Math.tan(60) etc. I don't need to have the class name. I can just say tan(60); If i didn't import it statically, example: import java.Math.; i would have to say Math.random() etc. So it only makes sense to import a class using static only if you are using a lot of the methods otherwise you lose out on readability.