4 ms·
This is the same as other languages. In for example Java you have `public void method()`, and you then `return` which results in a `null`
by tokenizerrr 10y ago
This is the same as other languages. In for example Java you have `public void method()`, and you then `return` which results in a `null`
- TazeTSchnitzel 10y agoAre you sure about that? I don't think you can use the results of void functions in Java as expressions.
- duskwuff 10y agoThis is completely incorrect. Java's null value is only valid as a value of an object type (e.g, Object x = null), and void functions don't return an object.
- tokenizerrr 10y agoThe compiler doesn't allow it, but if you call the function with for example reflection you get null.