We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 4: Class vs. Instance
Day 4: Class vs. Instance
Sort by
recency
|
1915 Discussions
|
Please Login in order to post a comment
Here is problem solution in Python, Java, C++, C and javascript - https://programmingoneonone.com/hackerrank-day-4-class-vs-instance-30-days-of-code-solution.html
what is wrong with my code please assist
this.age=initialAge; if(initialAge<0){ this.age=0; System.out.println("Age is not valid, settin age to 0."); }
TypeScript solution. Note, I added an
ageByhelper method to the Person class for to DRY up duplicate aging code :How am i supposed to debug if i am not allowed to change/ update the main[] method at all? This program seems to have problem in itself i.e. the testcase is failing because of extra blank space but i am unable to remove that additional print statement from the main[] method.
C# code of the Person class..