Constructor ?

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2006
Posts: 11
Reputation: iwlu is an unknown quantity at this point 
Solved Threads: 0
iwlu's Avatar
iwlu iwlu is offline Offline
Newbie Poster

Constructor ?

 
0
  #1
Nov 27th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Constructor ?

 
0
  #2
Nov 28th, 2006
without knowing what you're trying to do it's kinda hard to give you hints on how to do it.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC