You are writing a method that is declared not to return a value. Which two are permitted in the method body?
Correct Answer: A,D
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;
Question 52
Given: What is the result?
Correct Answer: C
Question 53
Given the code fragment: What is the result?
Correct Answer: B
Question 54
Given: Which code fragment can replace the if block?