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 |
Why is static used?
abstract class A{ int list []=new int [100]; A(int x,int y){ rondom n=new rondom(); for (int i==;i<100;i++); list [i]=x+r.next int(y-x+1); abstract sort (); abstract binary sarch(int temp); class B extends A{
What types of inheritance does Java support?
Are arrays dynamic in java?
Which is better ascii or unicode?
what are the different access specifiers that can be used by interfaces and abstract classes? can anyone give me detailed description on this
11 Answers IBM, L&T,
Can a method inside a interface be declared as final?
Why are getters and setters used?
What are Font and FontMetrics classes?
What are the loops in java?
Can we execute java program without main method?
What do you understand by the term singleton?