actually I went the wrong way I think, below is the the partial code area and the bold shows what needs tobe, but I know I didnt do it right, can anyone show me an example or where to find help?
if (myFields[c_shapeNameField].equals(ShapeName.circle)){
//ASSIGN a new Circle object to shapes[index], passing the Circle constructor the following arguments:
Shape[index] = new Circle(Integer.parseInt(myFields[c_xCoordinateField]),
Integer.parseInt(myFields[c_yCoordinateField]), Integer.parseInt(myFields[c_radiusField]));
}
else if (myFields[c_shapeNameField].equals(ShapeName.cube)){
//ASSIGN a new Cube object to shapes[index], passing the Cube constructor the following arguments:
Cube shape = new Cube(Integer.parseInt(myFields[c_xCoordinateField]),
Integer.parseInt(myFields[c_yCoordinateField]), Integer.parseInt(myFields[c_sideField]));
}
else if (myFields[c_shapeNameField].equals(ShapeName.sphere)){
//ASSIGN a new Sphere object to shapes[index], passing the Sphere constructor the following arguments:
Sphere shape = new Sphere(Integer.parseInt(myFields[c_xCoordinateField]),
Integer.parseInt(myFields[c_yCoordinateField]), Integer.parseInt(myFields[c_radiusField]));
}
else if (myFields[c_shapeNameField].equals(ShapeName.square)){
//ASSIGN a new Square object to shapes[index], passing the Square constructor the following arguments:
Square shape = new Square(Integer.parseInt(myFields[c_xCoordinateField]),
Integer.parseInt(myFields[c_yCoordinateField]), Integer.parseInt(myFields[c_sideField]));
}
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.