Structure if dans java
Résolu
yanounou
-
williamdes -
williamdes -
Bonjour,
voila je voudrais realiser un petit programme tou simple en java avec un if, le voila
public static void main (String[] args) {
String p1 = "fruit";
String p2 = "legumes";
if (p1 = p2)
System.out.println("Ces mots sont egaux");
else
System.out.println("Ces mots sont differents");
}
}
Mais au moment ou j'execute le programme ca me met : Type mismatch: cannot convert from String to boolean
d'ou le probleme pourrait venir???
voila je voudrais realiser un petit programme tou simple en java avec un if, le voila
public static void main (String[] args) {
String p1 = "fruit";
String p2 = "legumes";
if (p1 = p2)
System.out.println("Ces mots sont egaux");
else
System.out.println("Ces mots sont differents");
}
}
Mais au moment ou j'execute le programme ca me met : Type mismatch: cannot convert from String to boolean
d'ou le probleme pourrait venir???
A voir également:
- Structure if dans java
- Waptrick java football - Télécharger - Jeux vidéo
- Jeux java itel - Télécharger - Jeux vidéo
- Eclipse java - Télécharger - Langages
- Java apk - Télécharger - Langages
- Waptrick java voiture - Télécharger - Jeux vidéo
c génial