このログイン システムを機能させることができません。実行時にプログラムを表示したいのですが、
ユーザー名:
パスワード:
そして、資格情報を入力したいと思います。
これが私のコードです:
import java.util.Scanner;
public class Customer {
public void Login() {
Scanner sc = new Scanner(System.in);
System.out.print("SUPERMARKET - ONLINE PORTAL LOGIN \n");
System.out.print("Username: ");
System.out.print("\n");
System.out.print("Password: ");
String string = sc.nextLine();
if("hmirza".equals(string) )
{
String string2 = sc.nextLine();
if("mirza".equals(string2) )
{
System.out.print("Logging you in... ");
System.out.print("\n\n\n");
new Products().search();
}
}
sc.close();
}
}