Which of the following would not be an alternate
way to write remove() method?
public T remove()
{
T result = removeEntry(getIndexOf(null));
return result;
}
-
public T remove()
{
return removeEntry(numberOfEntries-1);
}
-
public T remove()
{
T result = null;
if (numberOfEntries > 0)
{
result = contents[numberOfEntries -1];
contents[numberOfEntries - 1] = null;
numberOfEntries--;
}
return result;
}
-
public T remove()
{
T result = removeEntry(numberOfEntries-1);
return result;
}
There are no hints for this question