Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    16
    Views
    2,923

    [SOLVED] Re: Help with classes & instance methods

    If a constructor has no arguments, then it has no values from the user to store into the classes member variables.
    Its up to the programmer that defines that constructor to put values into those...
  2. Replies
    16
    Views
    2,923

    [SOLVED] Re: Help with classes & instance methods

    Ok. Your code does follow the assignment statement if you read it that the class does the I/O. Another reading of the assignement could put the I/O outside the class. The intent of the statement:...
  3. Replies
    16
    Views
    2,923

    [SOLVED] Re: Help with classes & instance methods

    An unusual construct: not to initialize the member variables until get() is called. And ALWAYS to prompt for the sizes every time get() is called. Normally the sizes would be determined outside of...
  4. Replies
    16
    Views
    2,923

    [SOLVED] Re: Help with classes & instance methods

    Or

    public boolean isSquare(Rectangle r)
    {
    return (r.getLength() == r.getHeight());
    }
  5. Replies
    16
    Views
    2,923

    [SOLVED] Re: Help with classes & instance methods

    That would depend on how you want to use the method. Most likely you want to determine if a Rectangle is a square.
    If there are other shapes that you want to test, then the parameter might be...
Results 1 to 5 of 5