java.lang.StringIndex OutOfBounds Exception
Salut je suis un débutant et je m'amuse à faire des petits des programmes,
mais pour un début je suis confronté à une erreur
voici le code, pourriez vous m'aider
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
import java.util.Scanner;
public class Premier {
public static void main(String[] args ) {
double a;
char operateur;
double b;
Scanner sc = new Scanner(System.in);
a = sc.nextDouble();
System.out.println(a);
operateur = sc.nextLine().charAt(0);
System.out.println(operateur);
b=sc.nextDouble();
System.out.println(b);
}
} |