Search the Community
Showing results for tags 'constructor'.
-
Hi Larry, I have been working through the book and am at script 7.6 - rectangles5.cpp. Because of the constructor, I found that the setSize method is no longer needed as the constructor does the same job. I commented out all references to the setSize method and the application executes correctly in my Dev-C++ IDE. FYI, Cheers from Oz.
-
In Chapter 5 on pate 157 it says in a darker portlet: I need some more details on this. What concerns me is that I created a file in which I included Rectangle.php then I declared a new class such as: class Square extends Rectangle { } just an empty class and then called: $r = new Square(); for testing purposes I added the following line to Rectangle's constructor class: print "construction called"; and it does seem to be executed when new Square class is instantiated with no parameters passed! Is the documentation in the book wrong or am I missing something? Because the above code indicates that the parent constructor seems to be called? Thanks in advance