You are writing a method that is declared not to return a value.
Which two are permitted in the method body?
A.
omission of the return statement
B.
return null;
C.
return void;
D.
return;
Explanation:
Any method declared void doesn’t return a value. It does not need to contain a return statement, but it may do so. In such a case, a return statement can be used to branch out of a control flow block and exit the method and is simply used like this:
return;
A,D
A return statement can be used to branch out of a control flow block and exit the method and is simply used like this: return;
The Answer is A, D.