Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3003 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  LinkedList

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

LinkedList

n°555823
os2
Posté le 31-10-2003 à 18:44:22  profilanswer
 

a est un tableau de long...
LinkedList tmpList = new LinkedList( ); // die Hilfsliste
  for( int i = 0; i < a.length; i++ ){
    tmpList.addLast( a[ i ] );
 
l'erreur
Sort.java:24: addLast(java.lang.Object) in java.util.LinkedList cannot be applie
d to (long)
      tmpList.addLast( a[ i ] );
 
je ne comprend pas trop... cette méthode accepte des objets...
long n'est pas un object?


---------------
Borland rulez: http://pages.infinit.net/borland
mood
Publicité
Posté le 31-10-2003 à 18:44:22  profilanswer
 

n°555824
Joel F
Real men use unique_ptr
Posté le 31-10-2003 à 18:49:17  profilanswer
 

long non, Long oui
 
utilise Object plutôt

n°555826
Taiche
(╯°□°)╯︵ ┻━┻
Posté le 31-10-2003 à 18:52:17  profilanswer
 

Joel F a écrit :

long non, Long oui


:jap:

Joel F a écrit :


utilise Object plutôt


:??: I s'ra un peu emmerdé après, pour le get(), non ?


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
n°555829
os2
Posté le 31-10-2003 à 18:57:38  profilanswer
 

j'ai mis le tout en Long...
 


Message édité par os2 le 31-10-2003 à 19:02:32

---------------
Borland rulez: http://pages.infinit.net/borland
n°555936
maria2
un fan de vandamme
Posté le 31-10-2003 à 22:23:10  profilanswer
 

En fait, il faut que tu utilises la syntaxe :
 
tmpList.addLast(new Long(a[i]));  


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  LinkedList

 

Sujets relatifs
dans quel cas est il preferable d'utiliser vector ou linkedlist ?[SmallTalk] Iteration -> LinkedList
Plus de sujets relatifs à : LinkedList


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)