+ 1
What happens when you don't return anything?
4 Respostas
+ 1
you use void when you don't expect any value to be returned from that method. for example int height = calculateHeight (); then you expect the method will return integer value. But if you want your method only to do something then you can use void
0
it returns the garbage value.
0
if d return type is void.. den itz k.. else u jst need to type return.. so dat the cursor gets back to where it is called. ..
0
we can use void so that there is no need of return to be used....but once you r using int we need to return the value otherwise garbage value