public class Item {
private String title;
private int playingtime;
private boolean gotit;
private String comment;
public Item(String title, int playingtime) //constructor
{
this.title=title;
this.playingtime=playingtime;
this.gotit=false;
this.comment = "";
}
public void setComment(String comment)//method untuk memasukkan comment item
{
this.comment = comment;
}
public String getComment() //method untuk return comment item
{
return this.comment;
}
public void setGotIt(boolean gotit) //method untuk memasukkan ketersediaan item
{
this.gotit = gotit;
}
public boolean getGotIt() //method untuk return ketersediaan item
{
return this.gotit;
}
public void Print() //method untuk mencetak item
{
System.out.println("Title: " + title + "( " + playingtime + " mins )" );
//cek item tersedia atau tidak
if(gotit)
{
System.out.println("Available");
}
else
{
System.out.println("Not Available");
}
System.out.println(comment);
}
}