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 |
Can we overload final method in java?
What is arraylist e in java?
What are the 4 types of research methods?
What is formatted output in java?
How many objects are created when we create String class object using new operator?
How can you make a class serializable in java?
Can we declare register variable as global?
What are the different data types in java?
how an we achive multiple inhetitance in java using interface..??
how to minimize the functionality to will not force garbage collector?
Do I need to import java.lang package any time? Why?
what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread