0
How can I resolve this error?
8 Réponses
0
Hi Secret Look I again modified code for you
https://code.sololearn.com/cTm0ZnV9075D/?ref=app
+ 2
You must return something in the end of your method and outside of for loop. For example return a zero value (return 0)
+ 2
I fixed you code you can see below 👇
https://code.sololearn.com/cTm0ZnV9075D/?ref=app
+ 1
1. Just change the return type to void and remove return statement
2. replace int animalAge = cows[x][y] with System.out.println(cows[x][y])
3. and just call the animal function in main method
and you can also see the code 👇 😄
https://code.sololearn.com/cTm0ZnV9075D/?ref=app
0
Ok, but how can I print all the elements of 2d array?
0
I already did this, but I want to make a returned 2d array.
0
Thx
0
Welcome Bro