?? pair.java
字號:
/** This class represents a pair of objects. */
public class Pair
{
/** The first item of the pair. */
public Object firstItem;
/** The second item of the pair. */
public Object secondItem;
/** Create a pair with initial values v1 and v2.
Analysis: Time = O(1) */
public Pair(Object v1, Object v2)
{
firstItem = v1;
secondItem = v2;
}
/** String representation of the pair.
Analysis: Time = O(1) */
public String toString()
{
return ( "(" + firstItem + "," + secondItem + ")" );
}
/** Does this pair have equal variable values as the pair referenced by other?
Analysis: Time = O(1) */
public boolean equals(Object other)
{
Pair otherPair = (Pair) other;
return firstItem == otherPair.firstItem && secondItem == otherPair.secondItem;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -