Activity 3.11.1.
The following program segment should define a
Dog
class with a constructor that takes one parameter, name
, and sets the value of the Dog’s private name
attribute to that. There should also be a getName
method which returns the name
attribute of the Dog
object. But the blocks have been mixed up and include pairs of lines where one is unneeded. Drag the necessary code from the left to the right and put them in order so that the code would work correctly. Click the Check button to check your solution.