Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Vet class
package com.skiabox.java_apps2;
/**
* Created by administrator on 10/10/2016.
*/
public class Vet {
public void giveShot(Animal a)
{
System.out.println("The vet is giving a shot to " + a.getClass().getSimpleName());
//The animal reacts to the shot
a.makeNoise();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment