import java.util.Scanner;
public class boucles {
public static void main(String[] args) {
String prenom;
char reponse = 'o';
Scanner = new Scanner(System.in);
while (reponse == 'o')
System.out.println("Donnez un prenom :");
prenom = sc.nextLine();
System.out.println("bonjour " +prenom+ "Ca boom ?");
System.out.println("Veux tu réessayé ?");
reponse = sc.nextLine().charAt(0);
System.out.println("Au revoir...");
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Scanner cannot be resolved to a variable
sc cannot be resolved
sc cannot be resolved
import java.util.Scanner;
public class boucles {
public static void main(String[] args) {
String prenom;
char reponse = 'o';
Scanner = new Scanner(System.in);
while (reponse == 'o')
System.out.println("Donnez un prenom :");
prenom = sc.nextLine();
System.out.println("bonjour " +prenom+ "Ca boom ?");
System.out.println("Veux tu réessayé ?");
reponse = sc.nextLine().charAt(0);
System.out.println("Au revoir...");
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Scanner cannot be resolved to a variable
sc cannot be resolved
sc cannot be resolved