Search:

Type: Posts; User: Mr.777

Search: Search took 0.11 seconds.

  1. Replies
    11
    Views
    1,901

    Re: Setting constraints on a field

    Can't you just debug it on your own now? Try to find out the behaviour of your program by placing PRINT statements after each statement and find it's behaviour.
  2. Replies
    11
    Views
    1,901

    Re: Setting constraints on a field

    Yeah, so think logically, set before getting. Or simply remove x.getX() from the parametrized constructor.
  3. Replies
    11
    Views
    1,901

    Re: Setting constraints on a field

    x=getX();

    What's this line doing? Say, you are passing -20 to x in the parametrized(yours second) constructor and getX() will return you x's value that will be 0 as you didn't yet set.
  4. Replies
    11
    Views
    1,901

    Re: Setting constraints on a field

    Yes the first one is constructor of class Shape but not the second one.
    Constructor has no return type, neither void.
Results 1 to 4 of 4