我正在尝试使用 java 制作带有 POP3 命令的邮件系统。
当用户登录时,他们输入“USER”,后跟他们的用户名,例如“USER ben”
为了送他们一路走来,我想知道是否在这里:
import java.util.Scanner;
public class TestingPart1 {
public static void main(String[]args){
int on = 1;
while (on == 1){
System.out.println("+OK POP3 server ready");
Scanner answer = new Scanner(System.in);
String Input = answer.nextLine();
**if (Input.equals.("USER test")){
CommandInterpreter.handleUser(Input);
}**
我只能检查前四个字符 USER 以便当它通过 CommandInterpreter 时它仍然读取 USER 测试,但通过了这个阶段
谢谢 :)