Created
October 12, 2016 22:36
-
-
Save skiabox/6b9c8ec5c5c47c719e9057f23076720e to your computer and use it in GitHub Desktop.
Vet class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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