[Java] Vector, verschil tussen .add en .addElement

Pagina: 1
Acties:
  • 59 views sinds 30-01-2008

  • LAN
  • Registratie: Oktober 2000
  • Niet online
Bij het toevoegen van objecten aan een vector kom ik twee methodes tegen.

vector.add(object)
vector.addElement(object)

wat is het verschil? of is er geen verschil.
het werkt in ieder geval allebei.

  • marcusk
  • Registratie: Februari 2001
  • Laatst online: 26-09-2023
This method is identical in functionality to the add(Object) method (which is part of the List interface).
zie http://java.sun.com/j2se/1.4/docs/api/java/util/Vector.html#addElement(java.lang.Object)

gewoon hetzelfde dus.

  • Glimi
  • Registratie: Augustus 2000
  • Niet online

Glimi

Designer Drugs

(overleden)
addElement
public void addElement(Object obj)
Adds the specified component to the end of this vector, increasing its size by one. The capacity of this vector is increased if its size becomes greater than its capacity.
This method is identical in functionality to the add(Object) method (which is part of the List interface).


Parameters:
obj - the component to be added.
See Also:
add(Object), List
Even zelf in de api kijken is nie zo moeilijk hoor

  • LAN
  • Registratie: Oktober 2000
  • Niet online
Op maandag 01 april 2002 22:45 schreef Glimi het volgende:

[..]

Even zelf in de api kijken is nie zo moeilijk hoor
jo, bedankt, is wel lastig voor iemand die er weinig verstand van heeft.

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

M-A-N-U-A-L

Doet iets met Cloud (MS/IBM)


Dit topic is gesloten.