Search:

Type: Posts; User: GregBrannon

Search: Search took 0.07 seconds.

  1. Replies
    9
    Views
    1,404

    Re: Inheritance variables

    Well, do what you gotta do. Now that I understand the prof's requirements better, what's your question? I think if you create the class hierarchy that you've described, all should fall into place....
  2. Replies
    9
    Views
    1,404

    Re: Inheritance variables

    Square extends Point. Didn't see that coming (Edit: even though you stated it plainly enough - sorry I missed that), but now I understand why the Square() constructor requires 3 parameters.
  3. Replies
    9
    Views
    1,404

    Re: Inheritance variables

    I don't have the 2 weeks of experience to rely on, but based on what you've said, either Shape has the instance variables (x, y) that all subclasses inherit, or Shape contains an instance variable...
  4. Replies
    9
    Views
    1,404

    Re: Inheritance variables

    Still a bit confused, but if every Shape has an (x, y) - a point that defines where they are in space - then those variables are part of the super class, Shape. Square doesn't inherit them from...
  5. Replies
    9
    Views
    1,404

    Re: Inheritance variables

    I don't understand exactly what your problem is, but don't create the shape until the data has been gathered to create it. For example, "new Square()" should not be the first statement of the case...
Results 1 to 5 of 5