import java.util.Scanner;
class Person{
public String name;
public int pass;
public void Sc(){
Scanner scanner=new Scanner(System.in);
name=scanner.next();
pass=scanner.nextInt();
System.out.println(name+","+pass);
if( name =="abc" && pass==123){
System.out.println("登陸成功");
}
else{
System.out.println("登陸失敗");
}
}
}
public class Load {
public static void main(String [] args){
Person person=new Person();
person.Sc();
}
}
為什麼鍵盤輸入abc和123 會輸出登錄失敗
name要用equals來比內容