Tugas 3 : objek bunga dengan method acessor , mutator dan overloading

Tugas 3 : objek bunga dengan method acessor , mutator dan overloading

nama : riki arditia R
nim    : 2012420079


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bunga1;

/**
 *
 * @author -
 */
public class Bunga1 {
    private String nama;
    private String warna;
    private String bau;
  
    public Bunga1(){
  
    }
   
    public void bunga (){
   
    }
   
    public void infoBunga(String temp) {
        System.out.println("Nama = " + nama);
        System.out.println("Warna = " + warna);
        System.out.println("Bau = " + bau);
    }
   
     public String getNama (){
        return nama;
    }
   
     public void setNama(String temp){
        nama =temp;
   }
     public String getWarna (){
         return warna;
     }
     public void setWarna (String temp){
         warna=temp;
     }
    public String getBau (){
        return bau;
    }
   
   public void setBau(String temp){
       bau=temp;
   }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       System.out.println();
        Bunga1 riki = new Bunga1 ();
        riki.setNama("raflesia arnoldi");
        riki.setWarna("merah maroon");
        riki.setBau("busuk");
       
     riki.infoBunga(riki.getNama());
       
   
   
       
        // TODO code application logic here
   

    }
}







share this article to: Facebook Twitter Google+ Linkedin Technorati Digg
Posted by arek informatika, Published at 23.13 and have 0 komentar

Tidak ada komentar:

Posting Komentar