Advertisement
ferdhika31

Cinta OOP

Sep 16th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 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.  
  7. package love;
  8.  
  9. /**
  10.  *
  11.  * @author ferdhika31
  12.  */
  13. public class Love {
  14.     private String nama;
  15.     private boolean relation=false;
  16.     private String ret;
  17.    
  18.     public Love(String nama_saya,boolean relationship){
  19.         nama = nama_saya;
  20.         relation = relationship; //jomblo or not
  21.     }
  22.     public void nyariGebetan(){
  23.         if(relation==true)
  24.             ret = "Eh "+nama+" jangan ngedua!";
  25.         else
  26.             ret = "Cie "+nama+" Jomblo cie aha :p";
  27.         System.out.println(ret);
  28.     }
  29.     /**
  30.      * @param args the command line arguments
  31.      */
  32.     public static void main(String[] args) {
  33.         // TODO code application logic here
  34.         Love ferdhika = new Love("Ferdhika",false);
  35.         ferdhika.nyariGebetan();
  36.     }
  37.    
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement