Sometimes an acute shortage of cats is felt more keenly than hunger. To combat this unpleasant feeling, you need to implement the addNewCat method, which will add a new cat to your program each time it is called. Use it carefully. More cats means more responsibility. Don't forget to increase the counter by one each time a cat is created.
Cat register
- 2
Locked
Comments (8)
- Popular
- New
- Old
You must be signed in to leave a comment
Jorden R Hockings
8 February 2020, 20:37
this works but i am still getting a fail on the last requirement. do not know why can you please help????
0
KevinTing
5 December 2018, 05:26
please advise why this addNewCat() method has to be declared as "static", as I have tried many times with no static, which is always fail to increase cat number by 1.
public static void addNewCat() {
catCount = catCount + 1;
}
+1
Liew
16 April 2020, 03:58
might be because it is not taking in any parameters? not really sure.
0
Md Sait
10 November 2018, 12:06
please help
catCount=catCount++ is not working i had to write catCount=catCount+1; or catCount++; to get passed
can somebody please help me to understand why it is happening?
0
Austin
29 April 2019, 18:25
++catCount increments the value and immediately returns it.
catCount++ also increments the value but returns the unchanged value of the variable.
0
GarBer
22 May 2019, 14:14
catcount += 1 works
+2
imran khan
23 September 2018, 07:22
whats wrong with the code can anyone help plz
plz help me out with this code
0
Roman
24 September 2018, 05:29
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
0