⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 item.java

📁 java源码 java源码 值得一看 值得一看
💻 JAVA
字号:
/**   An item with a description and a part number.*/public class Item{    /**      Constructs an item.      @param aDescription the item's description      @param aPartNumber the item's part number   */   public Item(String aDescription, int aPartNumber)   {        description = aDescription;      partNumber = aPartNumber;   }   /**      Gets the description of this item.      @return the description   */   public String getDescription()   {        return description;   }   public String toString()   {        return "[descripion=" + description         + ", partNumber=" + partNumber + "]";   }   @LogEntry(logger="global") public boolean equals(Object otherObject)   {        if (this == otherObject) return true;      if (otherObject == null) return false;      if (getClass() != otherObject.getClass()) return false;      Item other = (Item) otherObject;      return description.equals(other.description)         && partNumber == other.partNumber;   }   @LogEntry(logger="global") public int hashCode()   {        return 13 * description.hashCode() + 17 * partNumber;   }   private String description;   private int partNumber;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -