package types;

public class BookInPackage {

  private int itemCode;
  private String title;

  public BookInPackage(int itemCode, String title) {
    setItemCode(itemCode);
    setTitle(title);
  }
  public BookInPackage(String title) {
    this(0, title);
  }

  public int getItemCode() {
    return itemCode;
  }
  public void setItemCode (int itemCode) {
    if (itemCode > 0) this.itemCode = itemCode; 
  }
  public String getTitle() {
    return title;
  }
  public void setTitle (String title) {
    this.title = title;
  }
  public void display() {
    System.out.println(itemCode + " " + title);
  }
}
