File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes static import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "static import" Watch "static import" New topic

static import

abin joy
Ranch Hand

Joined: Jul 29, 2008
Posts: 35
What does a static import signify?
for example import static java.util.Collections.sort.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46410
It allows you to pretend a static member of another class is now a static member of this class. Sorry haven't the time to go into more detail now.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15093

See Static Import.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: static import
It's not a secret anymore!