I am going through the OCP
Java SE7 Programmer Certification Guide V11 (work in progress) by Mapa Gupta. She says you shouldn't use names of classes in the override, but then seemingly contradicts that.
First: "You override the toString inappropriately, if it returns any text that is specific to a particular class, for example, name of class or value of a static variable:..."
Then she goes on to show examples of inappropriate overriding, but only with static variables, not names of classes. OK.
Then there is a Twist in the Tale Exercise asking which overrides are appropriate and inappropriate:
So I marked this as inappropriate because it returns the name of the class. But, she seemingly contradicts herself in the answer key, when she says:
"The method toString in classes Book3 and Book4 returns the value of title and its class name-which also exhibit appropriate definition of this method."
What???
So then I google all over the place, and nowhere does it say returning the names of classes is inappropriate, and in fact one source says it's good practice.
Somebody please help.