Search:

Type: Posts; User: jps

Search: Search took 0.11 seconds.

  1. Re: Having trouble dealing with objects using abstract methods/classes and polymorphi

    Well I wouldn't necessarily make the variables public, rather keep them private and use get and set methods to provide access to them. Protected would provide access to them in the triangle class...
  2. Re: Having trouble dealing with objects using abstract methods/classes and polymorphi

    When you say:
    super(b,h) you store your base and height in your super(rectangle) class. Rather than using new variables in the extended(triangle) class, you can refer to those in the super. Base...
  3. Re: Having trouble dealing with objects using abstract methods/classes and polymorphi

    Are you storing the same value in 2 different places? Once witin (super)rectangle's variables and once again within the triangle? Certianly don't need to keep the same data twice... Should be a way...
  4. Re: Having trouble dealing with objects using abstract methods/classes and polymorphi

    The reason you extended rectangle rather than just using it, is because some things are different. The important concept is to reuse what you can, and modify for your specific case in the new class....
  5. Re: Having trouble dealing with objects using abstract methods/classes and polymorphi

    Ok so geometry was longer ago than I can recall.
    So a correction to my last post.

    As far as the triangle, it should extend the rectangle class. Now that pbrockway2 pointed out my mistake, and i...
  6. Re: Having trouble dealing with objects using abstract methods/classes and polymorphi

    lol touche'
  7. Re: Having trouble dealing with objects using abstract methods/classes and polymorphi

    I want to add to this a bit more as it seems to me you have missed a crucial (and possibly the main) point of this assignment, as this is a very crucial concept in object oriented programming.
    ...
  8. Re: Having trouble dealing with objects using abstract methods/classes and polymorphi

    Actually if you consider the relationship among the limited shapes in the assignment, there is a clear answer.
    All 3 shapes can have the area volume and perimeter calculated by knowing the length of...
Results 1 to 8 of 8