944,077 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 1627
  • Java RSS
Nov 27th, 2006
0

Constructor ?

Expand Post »
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]));
          }
Last edited by iwlu; Nov 27th, 2006 at 10:33 pm.
Similar Threads
Reputation Points: 12
Solved Threads: 0
Newbie Poster
iwlu is offline Offline
11 posts
since Sep 2006
Nov 28th, 2006
0

Re: Constructor ?

without knowing what you're trying to do it's kinda hard to give you hints on how to do it.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is solved

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.
Message:
Previous Thread in Java Forum Timeline: Simpl JBank application
Next Thread in Java Forum Timeline: Database error cord identify





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC