LinkedList

LinkedList - Java - Programmation

Marsh Posté le 31-10-2003 à 18:44:22    

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
Reply

Marsh Posté le 31-10-2003 à 18:44:22   

Reply

Marsh Posté le 31-10-2003 à 18:49:17    

long non, Long oui
 
utilise Object plutôt

Reply

Marsh Posté le 31-10-2003 à 18:52:17    

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.
Reply

Marsh Posté le 31-10-2003 à 18:57:38    

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
Reply

Marsh Posté le 31-10-2003 à 22:23:10    

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

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed