Advertisement
Guest User

Untitled

a guest
May 24th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package javaapplication8;
  6.  
  7. /**
  8. *
  9. * @author Dicha
  10. */
  11. public class Animal {
  12.  
  13. protected int legs;
  14.  
  15. public Animal (){
  16.  
  17. }
  18.  
  19. protected Animal (int legs){
  20. this.legs=legs;
  21. System.out.println("Animal Legs + legs");
  22. }
  23.  
  24. public void walk(){
  25. System.out.println("Animal can walk.");
  26. }
  27.  
  28. public void eat(){
  29. System.out.println("Animal can eat.");
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement