Aracılığıyla paylaş


Class.GetInterfaces Method

Definition

Returns the interfaces directly implemented by the class or interface represented by this object.

[Android.Runtime.Register("getInterfaces", "()[Ljava/lang/Class;", "")]
public Java.Lang.Class[] GetInterfaces ();
[<Android.Runtime.Register("getInterfaces", "()[Ljava/lang/Class;", "")>]
member this.GetInterfaces : unit -> Java.Lang.Class[]

Returns

Class[]

an array of interfaces directly implemented by this class

Attributes

Remarks

Returns the interfaces directly implemented by the class or interface represented by this object.

If this object represents a class, the return value is an array containing objects representing all interfaces directly implemented by the class. The order of the interface objects in the array corresponds to the order of the interface names in the implements clause of the declaration of the class represented by this object. For example, given the declaration: <blockquote> class Shimmer implements FloorWax, DessertTopping { ...}</blockquote> suppose the value of s is an instance of Shimmer; the value of the expression: <blockquote> s.getClass().getInterfaces()[0]</blockquote> is the Class object that represents interface FloorWax; and the value of: <blockquote> s.getClass().getInterfaces()[1]</blockquote> is the Class object that represents interface DessertTopping.

If this object represents an interface, the array contains objects representing all interfaces directly extended by the interface. The order of the interface objects in the array corresponds to the order of the interface names in the extends clause of the declaration of the interface represented by this object.

If this object represents a class or interface that implements no interfaces, the method returns an array of length 0.

If this object represents a primitive type or void, the method returns an array of length 0.

If this Class object represents an array type, the interfaces Cloneable and java.io.Serializable are returned in that order.

Java documentation for java.lang.Class.getInterfaces().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to