Search:

Type: Posts; User: cslx99

Search: Search took 0.17 seconds.

  1. Replies
    11
    Views
    1,909

    Re: Setting constraints on a field

    so i took out the "getX();" line from the shape constructor:

    public Shape(int x, int y){
    this.x=x;
    this.y=y;
    }

    public int getX(){
    return...
  2. Replies
    11
    Views
    1,909

    Re: Setting constraints on a field

    quite honestly i have no idea why the "x=getX();" line is there, it was just my last effort in trying to get this to work. from my understanding, setX(); is supposed to set the new value for x. when...
  3. Replies
    11
    Views
    1,909

    Re: Setting constraints on a field

    so i got rid of the void. not sure why i had it there in the first place cuz i dont have it it any of my other constructors within my project. but i still cant seem to get the program to verify that...
  4. Replies
    11
    Views
    1,909

    Re: Setting constraints on a field

    so i have a book for java and a professor that say that the following are constructors:

    public Shape(){
    }

    &

    public void Shape(int x, int y){
    }
  5. Replies
    11
    Views
    1,909

    Re: Setting constraints on a field

    can you please clarify?
  6. Replies
    11
    Views
    1,909

    Setting constraints on a field

    i am coding a project that has "Shape" as the parent with various shapes (ie rectangle, triangle, etc.) as sub-classes using inheritance. i am supposed "Modify the constructor and set methods of the...
Results 1 to 6 of 6