What is the difference between add() and addElement()
method in Vector Class ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is string immutable in java?

545


Is java a pure object oriented language?

542


What is e in java?

543


I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?

525


What is singleton class example?

591






List primitive java types?

597


Is java written in c?

547


What are methods?

559


How transient variable is different from volatile variable?

565


What is http client in java?

523


What is method overloading with type promotion?

581


What is dot operator?

574


How do you end a program?

552


What are the differences between abstract class and interface?

515


What are peerless components?

625