题目内容

A return statement without any value can be used in _______.

A. a non-void method
B. void method

查看答案
更多问题

Does the return statement in the following method cause compile errors? public static void main(String[] args) {int max = 0;if (max != 0)System.out.println(max);elsereturn; }

A. Yes
B. No

You may have a return statement in a void method.

A. true
B. false

A _____ method does not return a value.

A. void
B. non-void

You must have a return statement in a non-void method.

A. false
B. true

答案查题题库