What is the difference between add() and addElement()
method in Vector Class ?
Answers were Sorted based on User's Feedback
Answer / sathya
add(int indx, Object e): Inserts the specified element at
the specified position in this Vector.Return type void
add(Object e):Appends the specified element to the end of
this Vector.Return type boolean
addElement(Object obj): Adds the specified component to the
end of this vector, increasing its size by one.Return type void.
| Is This Answer Correct ? | 19 Yes | 3 No |
Answer / sandhya sree malladi
This method is identical in functionality to the add
(Object) method (which is part of the List interface).
add(Object ) is due the fact that Vector implements List
Interface and it is appeared since Java 1.2 when Vector was
moved to Collections: The collection classes from earlier
releases, Vector and Hashtable, have been retrofitted to
implement the collection interfaces.
addElement is "original" Vector's method....
| Is This Answer Correct ? | 16 Yes | 4 No |
What does split function do in java?
What is an class?
How many bytes is a string?
What is difference between throw and throws ?
how to run ecllipse with jettyserver for windows environment using batch file
What is constructor and its types?
how can i cal servlet from jsp page?how can i pass variablesfrom the jsp that servlet can access?
java is pure object-oriented programming language?why it is platform independent.
What are the major drawbacks of external iteration?
What is the difference between ArrayList and Vector? which one is better in Java
0 Answers SkillGun Technologies,
What an i/o filter?
Which collection allows duplicate values in java?