R
Razvan
Hi !
Static synchronized methods are synchronizing on the runtime class of
an object. From the official documentation:
getClass()
public final Class getClass()Returns the runtime class of an object.
That Class object is the object that is locked by static synchronized
methods of the represented class.
Returns:
the object of type Class that represents the runtime class of the
object.
So, this runtime class object is a hidden object that is created only
when there is a static and synchronized method ? Aside from
synchronizing static methods I see no use for this object. Is it true
that this object is dedicated to synchronization ?
Regards,
Razvan
Static synchronized methods are synchronizing on the runtime class of
an object. From the official documentation:
getClass()
public final Class getClass()Returns the runtime class of an object.
That Class object is the object that is locked by static synchronized
methods of the represented class.
Returns:
the object of type Class that represents the runtime class of the
object.
So, this runtime class object is a hidden object that is created only
when there is a static and synchronized method ? Aside from
synchronizing static methods I see no use for this object. Is it true
that this object is dedicated to synchronization ?
Regards,
Razvan