In: Computer Science
Suppose your method does not return a value. Which of the following is true?
Group of answer choices:
A - You write no word for the return type.
B - Your return type should be void.
C - You write none as the return type.
D - You write public as the return type.
B) Your return type should be void
----------------------
Explanation:
When a method doesn't return any value, the return type should
be void,
void indicates that nothing will be returned by
the method.
Example:
In the above code, the printMsg function doesn't return
anything. Therefore we used void printMsg to
declare the method name.
Options A, C, D are incorrect and they would produce a compiler
error
B) Your return type should be void
---------------------------------------------------------------------------------------
Please give a thumbs up if you find this answer helpful.
If it doesn't help, please comment before giving a thumbs
down.
Please Do comment if you need any clarification.
I will surely help you.
Thankyou