public boolean verify(String nane, String pwd1,String pwd2) (
boolean flag=false
it(name. length()<3 omdl.lene+h0<6)[
Systcm.out.print1n( 用戶名長度不能小于3,密碼長度不能小于6
Jelse if(!pwdi.equais(pwd2))
System out.pzintin(兩次輸入的密碼不相同!”);
Jelse
System.out.printJn(注冊成功!請牢記用戶名和密碼。
flag=true
return flag
public static void main(String[]atgs
Register r=now Register
Scenner input Scanner(System. in)
Stringuname,p1,p2;
boolean resp=false
Syetem. out.printin(”+歡迎進入注冊系統種+\n")
dol
Systcn out.print(”請輸入用戶名:
Systemout,print(”請輸入密碼:
plFinput.next(o
Syatem out.print(”請再次輸入密碼
p2-input.nextO
while(! x.verify(unane. p1.p2
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/246991.html
標籤:Java相關
