Question 54 / 90:  Which of the following statements is/are true about declaring a return type?

(Choose all that apply.)


Choose 2
<< First < Previous Flashcard Next > Last >>
Explanation:

A and C.

A is correct because the void keyword means the method will not return any data.

C is correct because the data type of the variable to be returned must precede the method name.

B and D are incorrect.

B is incorrect because void is not optional if the method isn’t returning anything. The void keyword must be included in this condition.

D is incorrect because a method must always declare a return type or void. If it is a constructor, it can omit a return type and it will be implied as void.

Exam Home Page
https://www.jobilize.com/quiz-my-oca-mock-exam-by-mike-wolf

My OCA Mock

Author:

Access: Public Instant Grading

Ask
Michael Sag
Start Exam
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/quiz-my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>