5. What happens when more than one keyword appears in a string? Consider the string "My mother has a dog but no cat." Explain how to prioritize responses in the reply method. Did this impact any changes you made to the getResponse method?

Respuesta :

Answer:  

Please see below  

Explanation:  

When this is the case, the prioritizing will be done on the basis of whichever keyword came first in the string - it is that particular method that will be called. Hence, if you wish to prioritize the method available for pets over the method available for family, you will need to place it as such in the source code - and this is how the getResponse method will be impacted.