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...
Type: Posts; User: cslx99
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...
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...
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...
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){
}
can you please clarify?
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...