The constructor sets the name to "Scruffy" for each instance of the object that is created. To give the Dog object a different name you need to call the set method.
Another choice is to add another...
Type: Posts; User: Norm
The constructor sets the name to "Scruffy" for each instance of the object that is created. To give the Dog object a different name you need to call the set method.
Another choice is to add another...
You have coded Scruffy as a variable. If you want the value of name to be "Scruffy" you need to enclose it in "s.
What if you have another dog named Spot? How would you create a Dog object with a...
Is the variable name in the Dog class ever assigned a value? Its default value is null. If the code doesn't assign it a value, its value will be null. Look at the code to see how it can be made to...