Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CD extends Item
- {
- private String artist;
- private int numberoftracks;
- public CD(String title, int playingtime, String artist, int numberoftracks) //constructor
- {
- super(title,playingtime);
- this.artist=artist;
- }
- public void setComment(String comment) //method untuk memasukkan comment CD
- {
- super.setComment(comment);
- }
- public void setGotIt(boolean gotit) //method untuk memasukkan nilai ketersediaan CD
- {
- super.setGotIt(gotit);
- }
- public String getArtist() //method untuk return nama artist
- {
- return artist;
- }
- public int getNumber() //method untuk return jumlah tracks
- {
- return numberoftracks;
- }
- public void printArtist() //method untuk mencetak nama artist
- {
- System.out.println("Artist: " + artist);
- }
- }
Add Comment
Please, Sign In to add comment