I want to add a string after the age declaration. Depending if it is a dog or a puppy I want to add either "year" or "month" after. Is this possible?
- string name;
- int age;
- Animal cat = new Cat();
- cat.Name = name;
- cat.Age = age + "months"; // This I want to add a string after the int value
- Petowner.Pets.Add(cat);
Excuse me for my drawing skills :)
Amit GuptaPosted Mar 6, 2021, 5:35 PM
Chris AndersonPosted Mar 6, 2021, 5:29 PM
Amit GuptaPosted Mar 6, 2021, 5:20 PM