About Question enthuware.ocpjp.v7.2.1406 :
Posted: Tue Jun 11, 2013 5:07 am
The method addElement() is not a valid method of the List interface (it is a method used with the Interface Vector).
public void assertTest(List v)
{
assert v.size() == 10 : v.addElement("hello");
}
The method void add(int index, E element) can be used to recreate the problem.
public void assertTest(List v)
{
assert v.size() == 10 : v.add(0, "hello");
}
public void assertTest(List v)
{
assert v.size() == 10 : v.addElement("hello");
}
The method void add(int index, E element) can be used to recreate the problem.
public void assertTest(List v)
{
assert v.size() == 10 : v.add(0, "hello");
}