Created
March 17, 2015 01:59
-
-
Save eriwiana/77a33bc9b828178d5d29 to your computer and use it in GitHub Desktop.
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 hewan; | |
public class Hewan { | |
//int umur; | |
//int jumlahKaki; | |
//char[] nama; | |
public Hewan(){} | |
/*public void getJumlahKaki (int jumlahKakiHewan) { | |
jumlahKaki = jumlahKakiHewan; | |
} | |
public int getJumlahKaki() { | |
System.out.println("Jumlah Kaki Hewan " +jumlahKaki); | |
return jumlahKaki; | |
} | |
public void getUmur (int umurHewan){ | |
umur = umurHewan; | |
} | |
public int getUmur(){ | |
System.out.println("Umur hewan " +umur); | |
return umur; | |
} | |
public void getNama (char[] namaHewan){ | |
nama = namaHewan; | |
} | |
public char[] getNama(){ | |
System.out.println("Nama hewan " +nama); | |
return nama; | |
} | |
public void berbunyi(){ | |
System.out.println("hewan dapat berbunyi"); | |
} | |
public void berjalan(){ | |
System.out.println("hewan dapat berjalan"); | |
}*/ | |
public void makan() { | |
System.out.println("Hewan makan"); | |
} | |
public void berjalan(){ | |
System.out.println("Hewan mampu berjalan"); | |
} | |
public static void main(String[] args) { | |
// TODO code application logic here | |
/*kucing.getUmur(3); | |
kucing.getUmur(); | |
kucing.getJumlahKaki(4); | |
kucing.getJumlahKaki(); | |
//kucing.getNama(anjing); | |
kucing.berbunyi(); | |
kucing.berjalan();*/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment