object rectangle 目的矩形
Then define a function which computes the area for the rectangle object.
然后定义一个函数来计算Rectangle的面积。
But this is not object-oriented in its strict sense. A better approach would be to invoke a method on the Rectangle object rather than passing the object to a function.
但是这样做就不是一个严格意义上的面向对象了。
应用推荐