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 |
How do you read a char in java?
Is stringwriter thread safe?
Can we add two byte variables and assign the result to a byte variable ? b=b1+b2 where b,b1,b2 are byte types
What is variable and its types?
Explain class A{} class B{} class C{} all the three classes are saved in a single file name, what the name should i provide to the file ,in what file name should i run the program? Ple Explain
What is composition in java?
What is wrapper class example?
How can we pass argument to a function by reference instead of pass by value?
Why are the destructors for base class and derived class called in reverse order when the program exits
What does the three dot emoji mean?
Why spring singleton is not thread safe?
hoe can u call a constructor of a private classs to other inherited claa??