Bonjour, voila le probleme :
import java.util.Scanner;
public class Partie {
private String str;
public Partie(){
do{
System.out.println("L'animal est-il carnivore ?");
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
System.out.println(str);
}while(str!="oui");
}
}
Voila je n'arrive pas a comprendre pourquoi la boucle while ne s'arrete pas
en fait il me semble que str reprend la valeur NULL a chaque fois mais pourquoi ?