SHARE
TWEET

Untitled

reyhanzo Dec 17th, 2019 13 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class CD extends Item
  2. {
  3.     private String artist;
  4.     private int numberoftracks;
  5.     public CD(String title, int playingtime, String artist, int numberoftracks) //constructor
  6.     {
  7.         super(title,playingtime);
  8.         this.artist=artist;
  9.     }
  10.      
  11.     public void setComment(String comment) //method untuk memasukkan comment CD
  12.     {
  13.         super.setComment(comment);
  14.     }
  15.     public void setGotIt(boolean gotit) //method untuk memasukkan nilai ketersediaan CD
  16.     {
  17.         super.setGotIt(gotit);
  18.     }
  19.     public String getArtist() //method untuk return nama artist
  20.     {
  21.         return artist;
  22.     }
  23.     public int getNumber() //method untuk return jumlah tracks
  24.     {
  25.         return numberoftracks;
  26.     }
  27.     public void printArtist() //method untuk mencetak nama artist
  28.     {
  29.         System.out.println("Artist: " + artist);
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top