+ 3
Is void method with or without a parameter can return an int value?
2 Answers
+ 13
@Renzo : No, it's not so. You can create objects to call a void method as well as an int method, etc... It's just that if you want to return an int value, you should define a method of the int type. This is clearly covered in the Java course!
+ 14
Any method declared `void` doesn't return a value. It does not need to contain a return statement. If you try to return a value from a method that is declared void, you will get a compiler error.