0
In this program , why there is need to write Void before bark() method
public class Animal {ï»ż void bark() { ï»ż System.out.println("Woof-Woof");ï»ż }ï»ż }
2 Answers
- 1
If a function don't need to "return" something you should use "void"
public class Animal {ï»ż void bark() { ï»ż System.out.println("Woof-Woof");ï»ż }ï»ż }