Login with  Log in with facebook
Hiring Manager? SIGN UP HERE
1

Can a void method  contain 'return'?


08/07/2011 at 17:17
3 Answers
1
3

if it's for java, then yes you can have a void method with a return.  program flow will simply return to the statement immediately after the calling statement.

Ass Burgers
08/09/2011 at 02:13

2
0

No, compiler will not allow it.

Rishi Yadav
08/07/2011 at 21:54

3
0

yes, only thing is the return statement cannot have an expression following it.

 

Pravin Jain
08/27/2011 at 11:31

If you want to post any answer to this forum then you need to log in.
Schedule a Demo

Schedule a Demo with us

Name *
Email *
Phone *
Company *
Details