Infinite loop breaks method signature without compilation error [duplicate]
The final } of the method is unreachable – you only get a compilation error if it’s possible to get to the end of the method without returning a value. This is more useful for cases where the end of the method is unreachable due to an exception, e.g. private String find(int minLength) { for … Read more