You are viewing a single comment's thread. Return to all comments →
you need to set the persons age before testing on the class. So when you set to -1; You then re set in constructor
age = initialAge; if(initialAge <= 0){ age = 0; if(age == 0){ Console.WriteLine("Age is not valid, setting age to 0."); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 4: Class vs. Instance
You are viewing a single comment's thread. Return to all comments →
you need to set the persons age before testing on the class. So when you set to -1; You then re set in constructor