budsy remo wrote:
Why do i get "Rectangle@19821f" ?
When you print out the object, System.out.print() will call toString() on the object to get a
string that it can print. And since, you didn't implement the toString() method, it will inherit it from the Object class. The toString() method of the Object class generates a string with the class type and the identity hash code, which is what you see.
Henry