multiple constructors in same class

Jun 4, 2013 at 12:11am
My code work if I do not implement
newVehicleThree(automobileLetters);
newVehicleInt(automobileNumber);
in main. But I need to set the values into the constructor. What is the proper way to pass values to a constructor?
Last edited on Jun 4, 2013 at 6:39pm
Jun 4, 2013 at 12:29am
When you create the new objects using the constructor, don't just put int or string in the parenthesis. You need to put a integer value or string value for constructors to work. So don't create the objects beforehand. Just create an object when the number/string is given.
Last edited on Jun 4, 2013 at 12:30am
Topic archived. No new replies allowed.