Advertisement
cybergraph

MembuatMethodJava_Manusia

Oct 24th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 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. String nama;
  14. String alamat;
  15.  
  16.  
  17. void ubahData(String nm,String almt){
  18.  
  19. nama=nm;
  20. alamat=almt;
  21.  
  22. }
  23. void ubahNama(String nm){
  24. nama=nm;
  25. }
  26.  
  27. String ambilNama(){
  28.  
  29. return nama;
  30. }
  31.  
  32.  
  33. void hapusNama(){
  34.  
  35. nama="";
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement