Can't print a void return value. Either return a string, or do all the printing in bark().
Personally, having a method that prints " says Ruff!", and depending on the calling method to put something in front of it that makes sense, is the start of a bad API. Options would include just returning "ruff" and doing the additional work in the calling method, or doing the name + barking sound in the bark() method, but there are other options as well.
Arun C. Giridharan
Joined: Jul 11, 2010
Thank you .... i forgot about return type (String)