Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • I wasn't aware I could do this, so thank you @Jordi Castilla, however, how would I be able to reference the height and width properties of the objects I've created? Commented Apr 2, 2015 at 3:31
  • simply with name of created object and .propertyName i.e: for a new Rectangle rectangle = new Rectangle() you can refer height with rectangle.height Commented Apr 2, 2015 at 7:16
  • in order to improve your code, methods to calculate area and perimeter must take a Rectangle object !!! No they don't, It's unfortunately incorrect, in OOP methods are applied to objects and they're not functions that expects objects. Please DON'T be Confused with Functional Programming. A method in object-oriented programming (OOP) is a procedure associated with an object class, take a look here for further information. Commented Apr 2, 2015 at 10:05