Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public class Sepeda
  2. {
  3. int gigi;
  4. String merk;
  5.  
  6. //konstruktor
  7. public Sepeda()
  8. {
  9. this.gigi=0;
  10. this.merk="Federal";
  11. }
  12. public Sepeda(int g, String m)
  13. {
  14. this.gigi = g;
  15. this.merk = m;
  16. }
  17. public void setGigi(int g)
  18. {
  19. this.gigi=g;
  20. }
  21. public void setMerk(String m)
  22. {
  23. this.merk = m;
  24. }
  25. public int getGigi()
  26. {
  27. return this.gigi;
  28. }
  29. public String getMerk()
  30. {
  31. return this.merk;
  32. }
  33. public void berjalan()
  34. {
  35. System.out.println("Sepeda Berjalan");
  36. }
  37. public void belokKiri()
  38. {
  39. System.out.println("Sepeda Belok Kiri");
  40. }
  41. public void belokKanan()
  42. {
  43. System.out.println("Sepeda Belok Kanan");
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement