SHARE
TWEET

Untitled

a guest Sep 16th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Elephant extends Animal{
  2.    
  3.     private String name;
  4.    
  5.     public String getName() {
  6.         return name;
  7.     }
  8.  
  9.     public void setName(String name) {
  10.         this.name = name;
  11.     }
  12.  
  13.     public void speak(double weight,int age, String name) {
  14.         System.out.println("體重:"+weight+"kg,年紀:"+age+"歲,"+"名稱:"+name);
  15.     }
  16.  
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top