[Note] BufferedReader and length()


/ Published in: Java
Save to your folder(s)

a piece of code


Copy this code and paste it in your HTML
  1. import java.io.*;
  2. public class Practive{
  3. public static void main (String[] args){
  4. strmanip();
  5. }
  6. static void strmanip(){
  7. String name ="";
  8. String password="";
  9. try{
  10. System.out.println("Create a new user name");
  11. name = read.readLine();
  12. System.out.println("Create a new password");
  13. password=read.readLine();
  14. }catch (IOException e){}
  15. if (password.length()>8)
  16. System.out.println("Welcome "+ name +"!");
  17. else System.out.println("Your password must be greater than 8 characters");
  18.  
  19. }
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.