java登入校验

Scanner scanner=new Scanner(System.in);
System.out.println(“请输入数字”);
System.out.println(“1.注册用户”);
System.out.println(“2.退出系统”);
int num = scanner.nextInt();

	while (num==1) {
		System.out.println("注册系统");
		
		num=scanner.nextInt();
	}
	System.out.println("请输入用户名");
	int name=scanner.nextInt();
	String password=scanner.next();
	String password2=scanner.next();
	if (name<=6) {
		System.out.println("请重新输入用户名");
		name=scanner.nextInt();
	}

你可能感兴趣的:(java登入校验)