Thursday, May 19, 2011

Replacements for old methods in Vector API

The following methods have been changed from the old to the new Vector API.
Old Method New Method
void addElement(Object) boolean add(Object)
void copyInto(Object[]) Object[] toArray()
Object elementAt(int) Object get(int)
Enumeration elements() Iterator iterator()
ListIterator listIterator()
void insertElementAt(Object, int) void add(index, Object)
void removeAllElements() void clear()
boolean removeElement(Object) boolean remove(Object)
void removeElementAt(int) void remove(int)
void setElementAt(int) Object set(int, Object)

See here for ensuring use of new method API in java.

No comments:

Post a Comment

Chitika