Ask Your Question
2

Can the addition of a return statement be considered a negative practice in a void return type method?

asked 2023-03-17 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-06-08 19:00:00 +0000

scrum gravatar image

No, adding a return statement in a void return type method does not necessarily have a negative impact or considered a negative practice. It can be done to terminate the method early or to handle certain conditions. However, it is important to ensure that the return statement is adding value to the code and not causing any unwanted side effects.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-03-17 11:00:00 +0000

Seen: 16 times

Last updated: Jun 08 '21