Class.Name Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the name of the entity (class, interface, array class,
primitive type, or void) represented by this Class
object,
as a String
.
public string Name { [Android.Runtime.Register("getName", "()Ljava/lang/String;", "")] get; }
[<get: Android.Runtime.Register("getName", "()Ljava/lang/String;", "")>]
member this.Name : string
Property Value
the name of the class or interface represented by this object.
- Attributes
Remarks
Returns the name of the entity (class, interface, array class, primitive type, or void) represented by this Class
object, as a String
.
If this class object represents a reference type that is not an array type then the binary name of the class is returned, as specified by <cite>The Java™ Language Specification</cite>.
If this class object represents a primitive type or void, then the name returned is a String
equal to the Java language keyword corresponding to the primitive type or void.
If this class object represents a class of arrays, then the internal form of the name consists of the name of the element type preceded by one or more '[
' characters representing the depth of the array nesting. The encoding of element type names is as follows:
<blockquote><table class="striped"> <caption style="display:none">Element types and encodings</caption> <thead> <tr><th scope="col"> Element Type <th scope="col"> Encoding </thead> <tbody style="text-align:left"> <tr><th scope="row"> boolean <td style="text-align:center"> Z <tr><th scope="row"> byte <td style="text-align:center"> B <tr><th scope="row"> char <td style="text-align:center"> C <tr><th scope="row"> class or interface <td style="text-align:center"> Lclassname; <tr><th scope="row"> double <td style="text-align:center"> D <tr><th scope="row"> float <td style="text-align:center"> F <tr><th scope="row"> int <td style="text-align:center"> I <tr><th scope="row"> long <td style="text-align:center"> J <tr><th scope="row"> short <td style="text-align:center"> S </tbody> </table></blockquote>
The class or interface name classname is the binary name of the class specified above.
Examples: <blockquote>
String.class.getName()
returns "java.lang.String"
byte.class.getName()
returns "byte"
(new Object[3]).getClass().getName()
returns "[Ljava.lang.Object;"
(new int[3][4][5][6][7][8][9]).getClass().getName()
returns "[[[[[[[I"
</blockquote>
Java documentation for java.lang.Class.getName()
.
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.