0

I was trying to understand a code in java

When i come across "return -1" what does this return -1 do plis... https://code.sololearn.com/cZN0Yz9u4I6O/?ref=app

1st Sep 2019, 6:24 PM
stephen haokip
stephen haokip - avatar
1 Answer
+ 4
it is a default return value, since the method needs to return an int. if no solution if found it returns -1
1st Sep 2019, 6:41 PM
Anton Böhler
Anton Böhler - avatar