0

In this program , why there is need to write Void before bark() method

public class Animal {ļ»æ void bark() { ļ»æ System.out.println("Woof-Woof");ļ»æ }ļ»æ }

8th Sep 2019, 12:22 PM
Rupal Raut
2 Answers
+ 2
8th Sep 2019, 12:23 PM
Marina Vasilyova
Marina Vasilyova - avatar
- 1
If a function don't need to "return" something you should use "void"
8th Sep 2019, 12:25 PM
KfirWe
KfirWe - avatar