[Solved] code will generate compile error [closed]


The problem with this code is that not all paths of the code return a value… i.e. what if age is 0? You can fix this by adding after the last if statement return null this way if none of the conditions are met it will always have a return value.

solved code will generate compile error [closed]