Posted By

indecs on 08/21/15


Tagged


Versions (?)

[Note] BufferedReader and length()


 / Published in: Java
 

a piece of code

  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  

You need to login to post a comment.