共用方式為


Method.ToGenericString Method

Definition

Returns a string describing this Method, including type parameters.

[Android.Runtime.Register("toGenericString", "()Ljava/lang/String;", "")]
public override string ToGenericString ();
[<Android.Runtime.Register("toGenericString", "()Ljava/lang/String;", "")>]
override this.ToGenericString : unit -> string

Returns

a string describing this Method, include type parameters

Attributes

Remarks

Returns a string describing this Method, including type parameters. The string is formatted as the method access modifiers, if any, followed by an angle-bracketed comma-separated list of the method's type parameters, if any, followed by the method's generic return type, followed by a space, followed by the class declaring the method, followed by a period, followed by the method name, followed by a parenthesized, comma-separated list of the method's generic formal parameter types.

If this method was declared to take a variable number of arguments, instead of denoting the last parameter as "Type[]", it is denoted as "Type...".

A space is used to separate access modifiers from one another and from the type parameters or return type. If there are no type parameters, the type parameter list is elided; if the type parameter list is present, a space separates the list from the class name. If the method is declared to throw exceptions, the parameter list is followed by a space, followed by the word throws followed by a comma-separated list of the generic thrown exception types.

The access modifiers are placed in canonical order as specified by "The Java Language Specification". This is public, protected or private first, and then other modifiers in the following order: abstract, default, static, final, synchronized, native, strictfp.

Added in 1.5.

Java documentation for java.lang.reflect.Method.toGenericString().

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