Advertisement
nadejdachitakova

1aPenguin

Feb 17th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public class Penguin extends Animal{
  2.  
  3. public int maximumTemperature;
  4.  
  5. public Penguin(int cell, int temp) {
  6. super(Penguin.class.getSimpleName(), cell);
  7. maximumTemperature = temp;
  8. }
  9.  
  10. @Override
  11. public void move(String from, String to) {
  12. System.out.println("Swimmed from " + from
  13. + " to " + to);
  14. }
  15.  
  16. @Override
  17. public void eat() {
  18. System.out.println("Eats fish");
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement