My code work if I do not implement
in main. But I need to set the values into the constructor. What is the proper way to pass values to a constructor?
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.