Re: method to access the name of the object that got created.



if you mean class name, not the name of the object, than use
"theObject.getClass().getName()" method.
Otherwise, as gordon says, you need to define additional field with
the name of your rectangle.

.