Ivan Addeo wrote:So in case of Vampire class, the bool value is false so the exact string is "That's lame". Right?
This question is not correct. And other mistakes in it.
Java has data type "boolean", not "bool" (the latter would cause you a compile error). To say "exact string is..." is not correct. There are two print statements which would be executed accordingly to the returned value of method "frighten".
Nevertheless, in all cases two print statements would be executed in fred's given example. One from the "frighten" method no matter which value is returned, and one from the code snippet within the loop itself.
As fred suggested, you should give a try to execute and see what happens. P.S. as fred already mentioned in his provided code snippet could be some errors, there is one missing semicolon, I shall leave that to find out for yourself