A method defined without a return statement will cause a compile error.

A method defined without a return statement will cause a compile error.


Answer: False. If a method is declared to return void then it doesn’t need a return statement. However, if a method is declared to return a type other than void, then it must have a return statement.


Java

Learn More Multiple Choice Question :