Question: Write java doc for Jukebox.java. We don't have to make any changes in the program instead of change to Javadoc import java.util.ArrayList; import java.util.List; public
Write java doc for Jukebox.java. We don't have to make any changes in the program instead of change to Javadoc
import java.util.ArrayList; import java.util.List; public class Jukebox { Database db; int creditCard; public Jukebox(){ } public Jukebox(Database db, int creditCard) { super(); this.db = db; this.creditCard = creditCard; } public Database getDb() { return db; } public void setDb(Database db) { this.db = db; } public int getCreditCard() { return creditCard; } public void setCreditCard(int creditCard) { this.creditCard = creditCard; } public boolean isValidCreditCard(){ if(creditCard>0) return true; else return false; } void play(int i) { Song song=db.getSongList(i); song.play(); } void play() { for (int index=0;index tempSongList= new ArrayList(); tempSongList.add(song1); tempSongList.add(song2); tempSongList.add(song3); Database tempDB= new Database(tempSongList); Jukebox j= new Jukebox(tempDB, -123); //Validation of Credit Card System.out.println("Validity of CC : "+j.isValidCreditCard()); j.getDb().toString(); System.out.println(" Deleting Song @ index 2"); //Deleting Song @ index 2 j.getDb().removeSong(2); j.getDb().toString(); System.out.println("Playing the SongList"); j.play(); System.out.println("Playing Song @ index 2"); j.play(2); } } Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
