Advertisement
Guest User

Untitled

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