java类库详细讲解
源代码在线查看: classmodifiers.html
Listing the Modifiers of a Class Object
(Java Developers Almanac Example)
BODY CODE {font-family: Courier, Monospace; font-size: 11pt} TABLE, BODY {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} PRE {font-family: Courier, Monospace; font-size: 10pt} H3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11pt} A.eglink {text-decoration: none} A:hover.eglink {text-decoration: underline} -->
The Java Developers Almanac 1.4
Order this book from Amazon.
Home
>
List of Packages
>
java.lang.reflect
[17 examples]
>
Modifiers
[2 examples]
e112.
Listing the Modifiers of a Class Object
int mods = cls.getModifiers();
if (Modifier.isPublic(mods)) {
// class is public
}
Related Examples
e113.
Listing the Modifiers of a Member Object
See also:
Arrays
Constructors
Fields
Methods
© 2002 Addison-Wesley.