boulet21
Messages postés2Date d'inscriptionmercredi 9 novembre 2005StatutMembreDernière intervention 9 novembre 2005
-
9 nov. 2005 à 15:27
Anthed
Messages postés152Date d'inscriptiondimanche 20 février 2005StatutMembreDernière intervention17 janvier 2014
-
16 nov. 2005 à 20:42
Voici mon programme :
package karnaugh;
import java.util.*;
public class Gray extends ArrayList{
public Gray(String S) {
for(int i=0; i<S.length();i++)
{
boolean b = (S.charAt(i)==1)?true:false;
add(b);
}
}
}
et voilà le message d'erreur qui apparait...
Gray.java:8: cannot resolve symbol
symbol : method add (char)
location: class karnaugh.Gray
add(S.charAt(i));
^
Pour moi, un char est u déscendant d'Object, alors je ne comprends pas pourquoi cela ne marche pas
A voir également:
Java.sql.sqlrecoverableexception: erreur d'e/s: the network adapter could not establish the connection
Anthed
Messages postés152Date d'inscriptiondimanche 20 février 2005StatutMembreDernière intervention17 janvier 20143 16 nov. 2005 à 20:42
Petite remarque histoire de pas rajouter des tonnes de caractères pour rien:Boolean b new Boolean((s.charAt(i) 1) ? true : false);
se traduit en français par : si vrai, alors vrai, sinon faux ; un peu redondant, non ?
Il suffit d'écrire Boolean b new Boolean(s.charAt(i) 1);