Specifications
Sun Services
Java™ Programming Language
Module 7, slide 25 of 44
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Static Imports
•Astatic import imports the static members from a class:
import static
<pkg_list>
.
<class_name>
.
<member_name>
;
OR
import static
<pkg_list>
.
<class_name>
.*;
• A static import imports members individually or
collectively:
import static cards.domain.Suit.SPADES;
OR
import static cards.domain.Suit.*;
• There is no need to qualify the static constants:
PlayingCard card1 = new PlayingCard(SPADES, 2);
• Use this feature sparingly.










