Java easy to register membership system

Source: Internet
Author: User

 Public classLogin { Public Static voidMain (string[] args) {System.out.println (* * * Welcome to the registration system ******); BooleanFalg =false;  Do{System.out.println ("Please enter user name:"); Scanner input=NewScanner (system.in); String name=Input.next (); //If the user name length is greater than or equal to 3            if(Name.length () >= 3) {Falg=false; System.out.println ("Please enter your password:"); //Enter the password for the first timeString PSW1 =Input.next (); System.out.println ("Please enter your password again"); //re-enter the password, PSW1 and PSW2 compare the sameString PSW2 =Input.next (); //If the first input password length is greater than or equal to 6 digits and the first time the password and the second time the same                if(Psw1.length () >= 6 &&psw1.equals (PSW2)) {Falg=false; System.out.println ("Registration is successful!" "); //If the first input password length is greater than or equal to 6 digits and the first time the password and the second time is different}Else if(Psw1.length () >= 6 &&!PSW1. equals (PSW2)) {Falg=true; System.out.println ("Registration failed, two password input is not the same"); //the above conditions are not satisfied, indicating that the password length is less than 6 digits}Else{falg=true; System.out.println ("Password length must not be less than 6 digits"); }            } Else{falg=true; System.out.println ("User name length cannot be less than 3 digits"); }        }  while(FALG); }}

Java easy to register membership system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.