Skip to content

Instantly share code, notes, and snippets.

@eriwiana
Created March 17, 2015 01:59
Show Gist options
  • Save eriwiana/77a33bc9b828178d5d29 to your computer and use it in GitHub Desktop.
Save eriwiana/77a33bc9b828178d5d29 to your computer and use it in GitHub Desktop.
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