Yes you can. Check out static imports. You have to mention the class name in the import
statement, but after that you don't have to.e.g. from the linked article:
import static java.lang.Math.abs;
import static java.lang.Math.max;
int xDist = abs(destination.getX() - x);
int yDist = abs(destination.getY() - y);
return max(xDist, yDist);
Introduced in Java 5.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…