Object Class

Definition

Class Object is the root of the class hierarchy.

[Android.Runtime.Register("java/lang/Object", DoNotGenerateAcw=true)]
[System.Serializable]
public class Object : Java.Interop.JavaObject, Android.Runtime.IJavaObject, IDisposable
[<Android.Runtime.Register("java/lang/Object", DoNotGenerateAcw=true)>]
[<System.Serializable>]
type Object = class
    inherit JavaObject
    interface IJavaObject
    interface IDisposable
Inheritance
Derived
Attributes
Implements

Remarks

Class Object is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class.

Added in 1.0.

Java documentation for java.lang.Object.

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.

Constructors

Name Description
Object()

Constructs a new object.

Object(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Name Description
Class

Returns the runtime class of this Object.

Handle

The handle to the underlying Android instance.

JniIdentityHashCode

Gets the identity hash code assigned to this Java peer by the interop runtime.

JniManagedPeerState (Inherited from JavaObject)
JniPeerMembers

Gets the JNI metadata used to invoke members of this Java peer.

PeerReference

Gets the JNI object reference for this Java peer.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Name Description
Clone()

Creates and returns a copy of this object.

Construct(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
Dispose()

Releases the resources held by this Java peer.

Dispose(Boolean)

Releases the resources held by this Java peer.

DisposeUnlessReferenced() (Inherited from JavaObject)
Equals(Object)

Indicates whether some other object is "equal to" this one.

Equals(Object) (Inherited from JavaObject)
Finalize()

Releases resources before this Java peer is reclaimed.

FromArray<T>(T[])

Creates a Java array wrapper from the specified managed array.

GetHashCode()

Returns a hash code value for the object.

GetObject<T>(IntPtr, IntPtr, JniHandleOwnership)

Creates a managed Java peer of the requested type for the specified JNI object reference.

GetObject<T>(IntPtr, JniHandleOwnership)

Wraps a JNI object reference into a fully typed IJavaObject implementation.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

SetPeerReference(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
ToArray<T>()

Creates a managed array from this Java array wrapper.

ToString()

Returns a string representation of the object.

UnregisterFromRuntime()

Unregisters this Java peer from the interop runtime.

Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

Operators

Name Description
Explicit(Object to Boolean)

Converts the specified Object value to Boolean.

Explicit(Object to Boolean[])

Converts the specified Object value to Boolean array.

Explicit(Object to Byte)
Obsolete.

Converts the specified Object value to Byte.

Explicit(Object to Byte[])

Converts the specified Object value to Byte array.

Explicit(Object to Char)

Converts the specified Object value to Char.

Explicit(Object to Char[])

Converts the specified Object value to Char array.

Explicit(Object to Double)

Converts the specified Object value to Double.

Explicit(Object to Double[])

Converts the specified Object value to Double array.

Explicit(Object to Int32)

Converts the specified Object value to Int32.

Explicit(Object to Int32[])

Converts the specified Object value to Int32 array.

Explicit(Object to Int64)

Converts the specified Object value to Int64.

Explicit(Object to Int64[])

Converts the specified Object value to Int64 array.

Explicit(Object to Object[])

Converts the specified Object value to Object array.

Explicit(Object to SByte)

Converts the specified Object value to SByte.

Explicit(Object to Single)

Converts the specified Object value to Single.

Explicit(Object to Single[])

Converts the specified Object value to Single array.

Explicit(Object to String)

Converts the specified Object value to String.

Explicit(Object to String[])

Converts the specified Object value to String array.

Explicit(Object to UInt32)
Obsolete.

Converts the specified Object value to UInt32.

Explicit(Object to UInt64)
Obsolete.

Converts the specified Object value to UInt64.

Implicit(Boolean to Object)

Converts the specified managed Boolean value to Object.

Implicit(Boolean[] to Object)

Converts the specified managed Boolean array value to Object.

Implicit(Byte to Object)
Obsolete.

Converts the specified managed Byte value to Object.

Implicit(Byte[] to Object)

Converts the specified managed Byte array value to Object.

Implicit(Char to Object)

Converts the specified managed Char value to Object.

Implicit(Char[] to Object)

Converts the specified managed Char array value to Object.

Implicit(Double to Object)

Converts the specified managed Double value to Object.

Implicit(Double[] to Object)

Converts the specified managed Double array value to Object.

Implicit(Int32 to Object)

Converts the specified managed Int32 value to Object.

Implicit(Int32[] to Object)

Converts the specified managed Int32 array value to Object.

Implicit(Int64 to Object)

Converts the specified managed Int64 value to Object.

Implicit(Int64[] to Object)

Converts the specified managed Int64 array value to Object.

Implicit(Object[] to Object)

Converts the specified managed Object array value to Object.

Implicit(SByte to Object)

Converts the specified managed SByte value to Object.

Implicit(Single to Object)

Converts the specified managed Single value to Object.

Implicit(Single[] to Object)

Converts the specified managed Single array value to Object.

Implicit(String to Object)

Converts the specified managed String value to Object.

Implicit(String[] to Object)

Converts the specified managed String array value to Object.

Implicit(UInt32 to Object)
Obsolete.

Converts the specified managed UInt32 value to Object.

Implicit(UInt64 to Object)
Obsolete.

Converts the specified managed UInt64 value to Object.

Explicit Interface Implementations

Name Description
IJavaPeerable.Disposed() (Inherited from JavaObject)
IJavaPeerable.Finalized() (Inherited from JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock (Inherited from JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from JavaObject)

Extension Methods

Name Description
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to