+ 2
could you tell me what is my mistake
import java.util.Scanner; class MyClass { public static void main(String[] args) { Scanner m = new Scanner(System.in); String a = m.nextline(); String b = "bonjour"; if (a == b){ System.out.println("bonjour comment allez vous"); } else{ System.out.println("desole je ne comprend pas"); } } }
10 Antworten
+ 5
Donna your so considerate. That is good
+ 4
replace:
if(a==b){
with:
if(a.equals(b)){
+ 2
ok thanks
+ 2
ok thanks
+ 1
but SoloLearn say I have a error one the point of m. nextline
+ 1
but the program does not work
+ 1
thank you very much
0
use m.next()