Creates a new weak reference that refers to the given object and is
registered with the given queue.
Parameters:
-
referent - object the new weak reference will refer to
-
q - the queue with which the reference is to be registered,
or
null if registration is not required