If a method does not have a return statement, then


If a method does not have a return statement, then


a) it will produce a syntax error when compiled

b) it must be a void method

c) it can not be called from outside the class that defined the method

d) it must be defined to be a public method

e) it must be an int, double, or String method

Answer: b. Explanation: All methods are implied to return something and therefore there must be a return statement. However, if the programmer wishes to write a method that does not return anything, and therefore does not need a return statement, then it must be a void method (a method whose header has “void” as its return type).