Advertisement
cybergraph

MembuatConstructorJava_Manusia

Oct 24th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package pertemuan;
  7.  
  8. /**
  9. *
  10. * @author LK09NU17UTY
  11. */
  12. public class Manusia {
  13. private String nama;
  14. String alamat;
  15.  
  16. public Manusia(){
  17. System.out.println("Manusia Created");
  18. }
  19. public Manusia(String nama)
  20. {
  21. this.nama=nama;
  22. System.out.println(this.nama+"Created");
  23. }
  24.  
  25. void setNama(String nama)
  26. {
  27. this.nama=nama;
  28. }
  29.  
  30.  
  31.  
  32. String getNama(){
  33. return this.nama;
  34. }
  35.  
  36.  
  37.  
  38. void setAlamat(String alamat){
  39. this.alamat=alamat;
  40.  
  41.  
  42. }
  43.  
  44.  
  45. String getAlamat(){
  46. return this.alamat;
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement