我必须创建一个使用“is”方法的对象,基本上声明对象的状态。我不知道这应该如何工作。现在我写的方法作为布尔但我想知道我是否应该使用不同的方法,这里是代码,如何使用“is”方法
public class Cell
{
public int move;
public Cell(int xmove)
{
xmove = 0;
}
public boolean isempty(int x)
{
if(x == 0)
{
return true;
}
else
{
return false;
}
}
}
这是远不足够的信息。你如何期待我们知道该方法应该做什么? – Keppil 2013-04-23 19:26:16
布尔是'isSomething'或'hasSomething'等方法的一个好选择:) – Trinimon 2013-04-23 19:27:01
什么是“is”方法?一个名字中包含“is”的方法? – 2013-04-23 19:27:30