Stay organized with collections
Save and categorize content based on your preferences.
Member
public
interface
Member
Known indirect subclasses
Constructor<T> |
Constructor provides information about, and access to, a single
constructor for a class.
|
Executable |
A shared superclass for the common functionality of Method
and Constructor .
|
Field |
A Field provides information about, and dynamic access to, a
single field of a class or an interface.
|
Method |
A Method provides information about, and access to, a single method
on a class or interface.
|
|
Member is an interface that reflects identifying information about
a single member (a field or a method) or a constructor.
Summary
Constants |
int |
DECLARED
Identifies the set of declared members of a class or interface.
|
int |
PUBLIC
Identifies the set of all public members of a class or interface,
including inherited members.
|
Public methods |
abstract
Class<?>
|
getDeclaringClass()
Returns the Class object representing the class or interface
that declares the member or constructor represented by this Member.
|
abstract
int
|
getModifiers()
Returns the Java language modifiers for the member or
constructor represented by this Member, as an integer.
|
abstract
String
|
getName()
Returns the simple name of the underlying member or constructor
represented by this Member.
|
abstract
boolean
|
isSynthetic()
Returns true if this member was introduced by
the compiler; returns false otherwise.
|
Constants
DECLARED
public static final int DECLARED
Identifies the set of declared members of a class or interface.
Inherited members are not included.
Constant Value:
1
(0x00000001)
PUBLIC
public static final int PUBLIC
Identifies the set of all public members of a class or interface,
including inherited members.
Constant Value:
0
(0x00000000)
Public methods
getDeclaringClass
public abstract Class<?> getDeclaringClass ()
Returns the Class object representing the class or interface
that declares the member or constructor represented by this Member.
Returns |
Class<?> |
an object representing the declaring class of the
underlying member |
getModifiers
public abstract int getModifiers ()
Returns the Java language modifiers for the member or
constructor represented by this Member, as an integer. The
Modifier class should be used to decode the modifiers in
the integer.
Returns |
int |
the Java language modifiers for the underlying member |
getName
public abstract String getName ()
Returns the simple name of the underlying member or constructor
represented by this Member.
Returns |
String |
the simple name of the underlying member |
isSynthetic
public abstract boolean isSynthetic ()
Returns true
if this member was introduced by
the compiler; returns false
otherwise.
Returns |
boolean |
true if and only if this member was introduced by
the compiler. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Member\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Methods](#pubmethods) \n\nMember\n======\n\n\n`\npublic\n\n\ninterface\nMember\n`\n\n\n`\n\n\n`\n\n|--------------------------|\n| java.lang.reflect.Member |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [Constructor](/reference/java/lang/reflect/Constructor)\\\u003cT\\\u003e, [Executable](/reference/java/lang/reflect/Executable), [Field](/reference/java/lang/reflect/Field), [Method](/reference/java/lang/reflect/Method) |--------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Constructor](/reference/java/lang/reflect/Constructor)\\\u003cT\\\u003e | `Constructor` provides information about, and access to, a single constructor for a class. | | [Executable](/reference/java/lang/reflect/Executable) | A shared superclass for the common functionality of [Method](/reference/java/lang/reflect/Method) and [Constructor](/reference/java/lang/reflect/Constructor). | | [Field](/reference/java/lang/reflect/Field) | A `Field` provides information about, and dynamic access to, a single field of a class or an interface. | | [Method](/reference/java/lang/reflect/Method) | A `Method` provides information about, and access to, a single method on a class or interface. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nMember is an interface that reflects identifying information about\na single member (a field or a method) or a constructor. \n**See also:**\n\n- [Class](/reference/java/lang/Class)\n- [Field](/reference/java/lang/reflect/Field)\n- [Method](/reference/java/lang/reflect/Method)\n- [Constructor](/reference/java/lang/reflect/Constructor)\n\nSummary\n-------\n\n| ### Constants ||\n|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [DECLARED](/reference/java/lang/reflect/Member#DECLARED) Identifies the set of declared members of a class or interface. |\n| `int` | [PUBLIC](/reference/java/lang/reflect/Member#PUBLIC) Identifies the set of all public members of a class or interface, including inherited members. |\n\n| ### Public methods ||\n|------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getDeclaringClass](/reference/java/lang/reflect/Member#getDeclaringClass())`() ` Returns the Class object representing the class or interface that declares the member or constructor represented by this Member. |\n| ` abstract int` | ` `[getModifiers](/reference/java/lang/reflect/Member#getModifiers())`() ` Returns the Java language modifiers for the member or constructor represented by this Member, as an integer. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getName](/reference/java/lang/reflect/Member#getName())`() ` Returns the simple name of the underlying member or constructor represented by this Member. |\n| ` abstract boolean` | ` `[isSynthetic](/reference/java/lang/reflect/Member#isSynthetic())`() ` Returns `true` if this member was introduced by the compiler; returns `false` otherwise. |\n\nConstants\n---------\n\n### DECLARED\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int DECLARED\n```\n\nIdentifies the set of declared members of a class or interface.\nInherited members are not included.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\n### PUBLIC\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int PUBLIC\n```\n\nIdentifies the set of all public members of a class or interface,\nincluding inherited members.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\nPublic methods\n--------------\n\n### getDeclaringClass\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract Class\u003c?\u003e getDeclaringClass ()\n```\n\nReturns the Class object representing the class or interface\nthat declares the member or constructor represented by this Member.\n\n\u003cbr /\u003e\n\n| Returns ||\n|------------------------------------------|----------------------------------------------------------------------------|\n| [Class](/reference/java/lang/Class)`\u003c?\u003e` | an object representing the declaring class of the underlying member \u003cbr /\u003e |\n\n### getModifiers\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getModifiers ()\n```\n\nReturns the Java language modifiers for the member or\nconstructor represented by this Member, as an integer. The\nModifier class should be used to decode the modifiers in\nthe integer.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------------------------------------------------------------|\n| `int` | the Java language modifiers for the underlying member \u003cbr /\u003e |\n\n**See also:**\n\n- [Modifier](/reference/java/lang/reflect/Modifier) \n\n### getName\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getName ()\n```\n\nReturns the simple name of the underlying member or constructor\nrepresented by this Member.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|-------------------------------------------------|\n| [String](/reference/java/lang/String) | the simple name of the underlying member \u003cbr /\u003e |\n\n### isSynthetic\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean isSynthetic ()\n```\n\nReturns `true` if this member was introduced by\nthe compiler; returns `false` otherwise.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|------------------------------------------------------------------------|\n| `boolean` | true if and only if this member was introduced by the compiler. \u003cbr /\u003e |"]]