entry.java
来自「java编程代码」· Java 代码 · 共 36 行
JAVA
36 行
public class Entry
{
private String item;
private int count;
public Entry(String itemData, int countData)
{
item = itemData;
count = countData;
}
public String toString( )
{
return (item + " " + count);
}
public boolean equals(Object otherObject)
{
if (otherObject == null)
return false;
else if (getClass( ) != otherObject.getClass( ))
return false;
else
{
Entry otherEntry = (Entry)otherObject;
return (item.equals(otherEntry.item)
&& (count == otherEntry.count));
}
}
// <There should be other constructors and methods, including accessor and
// mutator methods, but we do not use them in this demonstration.>
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?