+ 1

if the method return no thing we can use println( v1.modifier())

https://code.sololearn.com/cDdkMMp2MjXM Thanks guys

4th Aug 2018, 1:54 PM
wally22
2 Answers
+ 8
No. The reason is because the modifier() method, being void, returns nothing at all, and hence the println method doesn't have anything to print out to the console. The JVM gives a compilation error, just for the same reason. PS. You can just call the modifier() method AS IS. v1.modifier(); like you've done on line 12!
4th Aug 2018, 2:03 PM
Dev
Dev - avatar
0
Thanks very helpfull !
4th Aug 2018, 3:23 PM
wally22