Created
February 12, 2013 01:20
-
-
Save rawaludin/4759243 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
class Sepeda { | |
public int posisiGigi; | |
public int kecepatan; | |
public String merk; | |
Sepeda() { | |
this.posisiGigi = 3; | |
this.kecepatan = 20; | |
this.merk = "Polygon"; | |
} | |
Sepeda(String merk, int kecepatan) { | |
this.merk = merk; | |
this.kecepatan = kecepatan; | |
} | |
public void tambahKecepatan() { | |
this.kecepatan = this.kecepatan+1; | |
} | |
public void cetakKecepatan() { | |
System.out.println("Current speed "+this.kecepatan+" km/s"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment